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

There are, it has been said, two types of people in the world. There are those who, when presented with a glass that is exactly half full, say: this glass is half full. And then there are those who say: this glass is half empty. The world *belongs*, however, to those who can look at the glass and say: What's up with this glass? Excuse me? Excuse *me*? This is my glass? I don't *think* so. My glass was full! *And* it was a bigger glass!
--(Terry Pratchett, The Truth)

Random Posts

  • yay, office supplies
  • Selling fish door to door
  • [recipe] Pastrami ribs
  • blergh
  • It’s the small pleasures in life
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