Re: Database config for large table

"Bill Champ" <[email protected]> Thu, 6 Apr 2006 13:53:07 -0500
Newsgroups gmane.comp.db.mckoi
Message-ID <[email protected]>
[email protected] said:

>From what we have observed, the database engine can't always make the
>correct assumptions about the contents of a database, and there have
>been several instances where just rearranging the conditions in a where
>clause have made a query run 100 times faster.

Yeah, that's true for a lot of database engines. I suspect it's true for
all of them. I'm just reluctant to say "all" because it's so final. Like
you said, how does it know which part of a WHERE clause will yield that
smallest intermediate results? It really helps when joining tables as
the intermediate joined tables can get quite large then only to get
small again as it filters out non-qualifying records.

A Hibernate book I read has the same advice for queries that use the
built-in Hibernate query language - place the most restrictive elements
first and the least restrictive last.

--Bill




---------------------------------------------------------------
Mckoi SQL Database mailing list  http://www.mckoi.com/database/
To unsubscribe, send a message to [email protected]