From: Arnau <arnaulist@andromeiberica.com>
To: pgsql-performance@postgresql.org
Subject: Queries with timestamps
Date: Wed, 21 Jan 2004 19:25:15 +0100
Message-ID: <029701c3e04b$ea608930$3c0aa8c0@iberica.andromeiberica.com> (raw)
Hi all,
I'm quite newbie in SQL and I have a performance problem. I have the
following table (with some extra fields) and without any index:
CREATE TABLE STATISTICS
(
STATISTIC_ID NUMERIC(10) NOT NULL DEFAULT
nextval('STATISTIC_ID_SEQ')
CONSTRAINT pk_st_statistic_id
PRIMARY KEY,
TIMESTAMP_IN TIMESTAMP,
VALUE NUMERIC(10)
);
The queries on this table are mainly related with the timestamp field,
e.g.:
select * from statistics where time::date < current_date - interval
'1 month';
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?
Thank you very much
--
Arnau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: arnaulist@andromeiberica.com
Subject: Re: Queries with timestamps
In-Reply-To: <029701c3e04b$ea608930$3c0aa8c0@iberica.andromeiberica.com>
References: <029701c3e04b$ea608930$3c0aa8c0@iberica.andromeiberica.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox