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

Re: Queries with timestamps

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: "Arnau" <arnaulist(at)andromeiberica(dot)com>,<pgsql-performance(at)postgresql(dot)org>
Subject: Re: Queries with timestamps
Date: 2004-01-21 19:06:06
Message-ID: 200401211106.06506.josh@agliodbs.com (view raw or flat)
Thread:
Lists: pgsql-performance
Arnau,

>     As the number of rows grows the time needed to execute this query takes
> longer.  What'd I should do improve the performance of this query?

Tip #1)  add an index to the timestamp column
Tip #2) make sure that you VACUUM and ANALYZE regularly
Tip #3) You will get better performance if you pass the "current_date - 1 
month" as a constant from the client instead of in the query.   This is a 
known issue, expected to be fixed in 7.5.

-- 
-Josh Berkus
 Aglio Database Solutions
 San Francisco


In response to

Responses

pgsql-performance by date

Next:From: Richard HuxtonDate: 2004-01-21 20:38:22
Subject: Re: Queries with timestamps
Previous:From: Bruno Wolff IIIDate: 2004-01-21 18:36:56
Subject: Re: ORDER BY and LIMIT with SubSelects

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