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

Re: Too slow querying a table of 15 million records

From: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
To: kjelle(at)bingon(dot)no
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Too slow querying a table of 15 million records
Date: 2005-06-28 08:50:42
Message-ID: 42C10F62.8030703@familyhealth.com.au (view raw or flat)
Thread:
Lists: pgsql-performance
> 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 ;

Try going:

time > '2005-06-28 15:34:00'

ie. put in the time 24 hours ago as a literal constant.

Chris


In response to

pgsql-performance by date

Next:From: Praveen RajaDate: 2005-06-28 09:50:08
Subject: Re: Insert performance vs Table size
Previous:From: Klint GoreDate: 2005-06-28 08:36:35
Subject: Re: How can I speed up this function?

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