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

Re: Too slow querying a table of 15 million records

From: John A Meinel <john(at)arbash-meinel(dot)com>
To: Tobias Brox <tobias(at)nordicbet(dot)com>
Cc: kjelle(at)bingon(dot)no, pgsql-performance(at)postgresql(dot)org
Subject: Re: Too slow querying a table of 15 million records
Date: 2005-06-28 06:35:07
Message-ID: 42C0EF9B.3070308@arbash-meinel.com (view raw or flat)
Thread:
Lists: pgsql-performance
Tobias Brox wrote:

>[kjelle(at)bingon(dot)no - Tue at 08:33:58PM +0200]
>
>
>>I use FreeBSD 4.11 with PostGreSQL 7.3.8.
>>
>>
>(...)
>
>
>>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 ;
>>
>>
>
>I haven't looked through all your email yet, but this phenomena have been up
>at the list a couple of times.  Try replacing "now() - interval '24 hours'"
>with a fixed time stamp, and see if it helps.
>
>pg7 will plan the query without knowledge of what "now() - interval '24
>hours'" will compute to.  This should be fixed in pg8.
>
>
>
The grandparent was a mailing list double send. Notice the date is 1
week ago. It has already been answered (though your answer is still
correct).

John
=:->

In response to

pgsql-performance by date

Next:From: Tom LaneDate: 2005-06-28 06:40:56
Subject: Re: Poor index choice -- multiple indexes of the same columns
Previous:From: Michael FuhrDate: 2005-06-28 06:26:20
Subject: Re: Postgresql7.4.5 running slow on plpgsql function

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