Re: Index on timestamp field, and now()
От | Tom Lane |
---|---|
Тема | Re: Index on timestamp field, and now() |
Дата | |
Msg-id | 21253.1013525316@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: Index on timestamp field, and now() (Denis Perchine <dyp@perchine.com>) |
Ответы |
Re: Index on timestamp field, and now()
|
Список | pgsql-general |
Denis Perchine <dyp@perchine.com> writes: > webmailstation=> explain select * from queue where send_date > timestamp > 'now'; > NOTICE: QUERY PLAN: > > Seq Scan on queue (cost=0.00..10114.06 rows=80834 width=190) > > EXPLAIN > > queue | send_date | 0 | 8 | -1 | > | > | > {"2001-12-27 21:58:24-05","2002-02-12 08:48:18.967111-05","2002-02-12 > 15:14:51.89063-05","2002-02-13 04:06:19.979181-05","2002-02-13 > 16:20:37.753221-05","2002-02-14 12:03:09.714262-05","2002-02-15 > 15:15:58.04151-05","2002-02-17 11:06:16.964311-05","2002-02-20 > 08:40:57.795043-05","2002-03-12 07:25:46-05","2003-10-28 14:58:58-05"} > | -0.359735 According to this histogram, 90% of your table has send_date in the future. Accordingly, seqscan is the right plan for the above query. regards, tom lane
В списке pgsql-general по дате отправления: