Re: index compatible date_trunc in postgres?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: index compatible date_trunc in postgres?
Дата
Msg-id 6850.1229693543@sss.pgh.pa.us
обсуждение исходный текст
Ответ на index compatible date_trunc in postgres?  (Bryce Nesbitt <bryce2@obviously.com>)
Ответы Re: index compatible date_trunc in postgres?  (Bryce Nesbitt <bryce2@obviously.com>)
Список pgsql-sql
Bryce Nesbitt <bryce2@obviously.com> writes:
> I've got a legacy app that does 8.3 incompatible date searches like so:
> explain select count(*) from contexts where publication_date like '2006%';
> explain select count(*) from contexts where publication_date like
> '2006-09%';

> I've got my choice of refactoring, but all these share the same
> sequential scan limitation:

Why are you worrying?  The old method surely didn't get indexed either.

(At least, it didn't unless you had an index on publication_date::text,
in which case just throwing in the cast will produce the same results
in 8.3.)
        regards, tom lane


В списке pgsql-sql по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: index compatible date_trunc in postgres?
Следующее
От: "Sebastian Rychter"
Дата:
Сообщение: Downgrade database and problem with sequences