Re: Query tuning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





2009/8/19 Grzegorz Jaśkiewicz <gryzman@xxxxxxxxx>
that seems to be the killer:

and time >= extract ('epoch' from timestamp '2009-08-12')
and time < extract ('epoch' from timestamp '2009-08-13' )

You probably need an index on time/epoch:

CREATE INDEX foo ON table(extract ('epoch' from timestamp time );

It looks like those extracts just make constant integer times. You probably just create an index on the time column.

Also, why not store times as timestamps?
 


or something like that, vacuum analyze and retry.

--
Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux