db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeffrey Lichtman <swa...@rcn.com>
Subject Re: Hints
Date Sun, 17 Oct 2004 03:53:39 GMT

>What is forcing you to use hints?
>Query planner should use that index automatically.
>It it does not, it did a poor job. It would be good to know why and fix it.
>Having SQL database with declarative query syntax without need to worry
>about how it will be executed is very important for usability.

I have been working with databases and optimizers for about twenty years. I 
have yet to see an optimizer that gets everything right every time. 
Optimizers rely on cost estimates and modeling that cannot always be 
accurate. Sometimes a poor query plan is caused by a bug, but sometimes 
it's caused by something the implementation didn't anticipate (or couldn't 
reasonably be expected to anticipate). Optimizer hints allow the user to do 
something in the inevitable cases where the query optimizer doesn't choose 
an adequate plan, for whatever reason. Without hints, the user is stuck 
until someone changes the optimizer - a task that is often very difficult.

                        -        Jeff Lichtman
                                 Check out Swazoo Koolak's Web Jukebox at

View raw message