From: Dmitry Y. <di...@us...> - 2005-06-03 12:04:11
|
"Alex Kotov" <al_...@uk...> wrote: > > First of all I need a clarify my point a bit -- Firebird (1.5.2) reports > that index _is_ used (i.e. you're correct) but query execution time is > unacceptable. > > [snip] > > 5) Please execute both queries below and compare time of execution: > a) select recid from mytable where status = 0; > b) select recid from mytable where status < 1; (status < 1) performs a range index scan looking for 0 and 1 values (i.e. the upper bound is strict). Values of 1 are eliminated later, after all corresponding records are fetched from cache/disk. For non-uniform data distribution, this may become a real performance issue. This is exactly what you observe. This is going to be improved in the future versions. Dmitry |