Skip to content
The beaver is a proud and noble animal

The beaver is a proud and noble animal

Notes from a bemused canuck

  • Home
  • About
  • Bookmarks
  • Pictures
  • Resume
  • Wine
  • Random Recipe
  • Toggle search form

Day: July 7, 2005

On the value of database indexes

Posted on July 7, 2005 By admin

Been trying to wrap my head around a bug at work, why a simple database query never returned a result set and crashed the server. The query is a simple left join from a “term” table with 40K records to a “term_synonym” table with 140K records. It should be straightforward. It should work.

It didn't.

For a very, very stupid reason on my part.

I'd forgotten to create indexes on the tables and it was doing full table scans. That comes out to 5,600,000,000 iterations over the term_synonym table. No wonder it was slow.

After creating the index:

mysql> select count(*) from term t left join term_synonym ts on  t.term_id = ts.term_id;
+----------+
| count(*) |
+----------+
|   156746 |
+----------+
1 row in set (1.72 sec)

Um, ya, I suck.

uncategorized

just FYI

Posted on July 7, 2005 By admin 5 Comments on just FYI

Just so you all know, Katy and I are fine. No need to worry.

We now return to your regularly scheduled insanity.

uncategorized

Power to the beaver!

Show me the beaver!
July 2005
M T W T F S S
 123
45678910
11121314151617
18192021222324
25262728293031
« Jun   Aug »

Quote of the day

One of the universal rules of happiness is: always be wary of any helpful item that weighs less than its operating manual.
--(Terry Pratchett, Jingo)

Random Posts

  • Find the Bobble
  • Dave Gorman’s PowerPoint adventure
  • Cleaning out files, just so I don’t lose them
  • Weather-appropriate Bean
  • Setting up the garcony… or is that the balcorden
reading leopard

Tags

bobble the little blue owl boobies brought to you by the fda cats chonk christmas comics computers are evil covid-19 dealing with idiots dilbert dog ducks galleries geek god bless the land of the free holidays house I am Canadian land of cheese and chocolate linked news lolcat london news from the stupid not my dog nsfw pets pictures potd2014 qotd random shit re-member recipes relationship shrill slice of life stress Tao the british way The Peanut things i miss travel video wine work

Archives

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Copyright © 2026 The beaver is a proud and noble animal.

Powered by PressBook Premium theme