Subject | Re: Firebird 2.1.x Indexing |
---|---|
Author | Adam |
Post date | 2008-09-19T10:13:31Z |
>using JOIN.
> >I don't think it is fair to call such SQL "unsmart". I have seen much
> >unsmart SQL (and admit to writing my fair share of it), but when you
> >have an arbitrary list of items you want to query (based on user
> >feedback or other factors external to the dbms such as sensor
> >information), you really have three options.
> >
> >Firstly, you can use IN. Secondly, you can create a complex mix of
> >BETWEEN and OR statements (with brackets for order of operations).
> >This can cause less index hits if you expect blocks of consecutive
> >integers. Thirdly, you can insert the "interesting" record identifiers
> >into a temporary table then join to it.
>
> You forgot a fourth option that sometimes is a great option, simply
You can't join to an arbitrary list of items that are decided by
processes external to the dbms. ;)
Adam