Re: correct example of a functional index usage? - Mailing list pgsql-general

From Dennis Gearon
Subject Re: correct example of a functional index usage?
Date
Msg-id 41791841.8060607@fireserve.net
Whole thread Raw
In response to Re: correct example of a functional index usage?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: correct example of a functional index usage?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
But it is possible to use multiple indexes on dates, and that is why the one at the bottom works, right?

Would a single index get used for

SELECT appointment
FROM the_table
WHERE 0 <> (date_mask &&  date_range);


Tom Lane wrote:
>
>
> No, an index can be used for one or the other.  Since we don't yet have
> bitmap combining of indexes, you don't get to apply two indexes in a
> single query.  Even if you did, this would be relatively inefficient
> since each index would return a whole lotta rows.
>
> Why don't you just do the straightforward thing and look for
>
> WHERE appointment_date >= 'some_date'
>   AND appointment_date <= 'some-other-date'
>
> AFAICS that solves the stated problem.  Maybe you were not being clear
> about what you want?
>
>             regards, tom lane
>


pgsql-general by date:

Previous
From: Richard_D_Levine@raytheon.com
Date:
Subject: Re: Two questions from the boss (SQL:2003 && scalability)
Next
From: Jan Wieck
Date:
Subject: Re: Slony-I 1.0.4 Released