Re: correct example of a functional index usage?
От | Dennis Gearon |
---|---|
Тема | Re: correct example of a functional index usage? |
Дата | |
Msg-id | 41791841.8060607@fireserve.net обсуждение исходный текст |
Ответ на | Re: correct example of a functional index usage? (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: correct example of a functional index usage?
|
Список | 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 по дате отправления: