Subject | Re: [firebird-support] Computed index |
---|---|
Author | Ann Harrison |
Post date | 2013-10-09T16:20:57Z |
On Wed, Oct 9, 2013 at 7:29 AM, Tim Ward <tdw@...> wrote:I've got a query containing
... WHERE ... (MYFIELD in (1,3,4,5,7,8,9,11,12,13))
which runs horribly slowly, because (quite reasonably) the query
optimiser gives up on that, even though it's got an index on MYFIELD.It might make sense to ask forMYFIELD between 1 and 13 andMYFIELD+0 in (1,3,4,5,7,8,9,11,12,13)Not of course if all the MYFIELDS are between 1 and 13 and most havesignificant fractional parts. Firebird indexes are pretty good at ranges -not great,but OK - and a range means coming down from the top of theindex once and reading across rather than coming down from the toponce per value as it must do with the IN portion.Good luck,Ann