in reply to Perl and MySQL woes

a subselect causes a full table scan in most databases
some databases will do a full scan if the where condition looks too complicated (for the db engine.) wherever possible make sure that values in tested column(s) don't need casting for comparison, and simplify the condition as much as possible. In this particular case, instead of >=20071204 can be written as >20071203.
i suggest a great little book "SQL for smarties" by Joe Celko
the hardest line to type correctly is: stty erase ^H

Replies are listed 'Best First'.
Re^2: Perl and MySQL woes
by jasonk (Parson) on Jan 14, 2008 at 01:55 UTC

    i suggest a great little book "SQL for smarties" by Joe Celko

    This book is a great suggestion, but having just updated this week to the latest edition, it's not so little anymore...


    We're not surrounded, we're in a target-rich environment!