Re: Query tuning

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

 





2009/8/19 Kevin Kempter <kevink@xxxxxxxxxxxxxxxxxxx>

We do have an index on url_hits.time

not sure why timestamps were not used, I was not here for the design phase.

What's type of time column? I don't like it casts it to double in explain. If it is integer, may be you need to change

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

to

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

for the index to be used?

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

  Powered by Linux