Skip site navigation (1) Skip section navigation (2)

Re: Query tuning

From: Віталій Тимчишин <tivv00(at)gmail(dot)com>
To: Kevin Kempter <kevink(at)consistentstate(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Query tuning
Date: 2009-08-20 12:03:07
Message-ID: 331e40660908200503o1a24aa42pb25210fb59691f88@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-performance
2009/8/19 Kevin Kempter <kevink(at)consistentstate(dot)com>

>
> 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?

In response to

pgsql-performance by date

Next:From: Ivan VorasDate: 2009-08-20 12:50:23
Subject: Re: PG 8.3 and server load
Previous:From: Fabio La FarcioliDate: 2009-08-20 08:35:19
Subject: Re: Number of tables

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group