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

Re: Querying 19million records very slowly

From: Tobias Brox <tobias(at)nordicbet(dot)com>
To: Kjell Tore Fossbakk <kjelltore(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Querying 19million records very slowly
Date: 2005-06-22 08:03:57
Message-ID: 20050622080357.GW7839@tobias (view raw or flat)
Thread:
Lists: pgsql-performance
[Kjell Tore Fossbakk - Wed at 09:45:22AM +0200]
> database=> explain analyze select count(*) from test where p1=53 and
> time > now() - interval '24 hours' ;

Sorry to say that I have not followed the entire thread neither read the
entire email I'm replying to, but I have a quick hint on this one (ref my
earlier thread about timestamp indices) - the postgresql planner will
generally behave smarter when using a fixed timestamp (typically generated
by the app server) than logics based on now().

One of my colleagues also claimed that he found the usage of
localtimestamp faster than now().

-- 
Tobias Brox, +86-13521622905
Nordicbet, IT dept

In response to

Responses

pgsql-performance by date

Next:From: Kjell Tore FossbakkDate: 2005-06-22 08:18:30
Subject: Re: Querying 19million records very slowly
Previous:From: Kjell Tore FossbakkDate: 2005-06-22 07:45:22
Subject: Re: Querying 19million records very slowly

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