From: PFC <lists@boutiquenumerique.com>
To: kjelle@bingon.no
To: pgsql-performance@postgresql.org
Subject: Re: Too slow querying a table of 15 million records
Date: Tue, 28 Jun 2005 19:10:05 +0200
Message-ID: <op.ss3ba3loth1vuj@localhost> (raw)
In-Reply-To: <19310.193.213.27.25.1119378838.squirrel@webmail.s7.itpays.net>
References: <19310.193.213.27.25.1119378838.squirrel@webmail.s7.itpays.net>
> database=> explain select date_trunc('hour', time),count(*) as total from
> test where p1=53 and time > now() - interval '24 hours' group by
> date_trunc order by date_trunc ;
1. Use CURRENT_TIMESTAMP (which is considered a constant by the planner)
instead of now()
2. Create a multicolumn index on (p1,time) or (time,p1) whichever works
better
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 using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: lists@boutiquenumerique.com, kjelle@bingon.no
Subject: Re: Too slow querying a table of 15 million records
In-Reply-To: <op.ss3ba3loth1vuj@localhost>
* 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