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: Michael Glaesemann <grzm(at)myrealbox(dot)com>,Tobias Brox <tobias(at)nordicbet(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Querying 19million records very slowly
Date: 2005-06-22 09:36:44
Message-ID: 20050622093644.GA7839@tobias (view raw, whole thread or download thread mbox)
Lists: pgsql-performance
[Kjell Tore Fossbakk - Wed at 11:10:42AM +0200]
> Which one does Pg read fastes? Does he convert datetime in the table,
> then my where clause and check, for each row? How does he compare a
> datetime with a datetime? Timestamp are easy, large number bigger than
> another large number..
> time (datetime) > '2005-06-21 10:36:22+02'
> or 
> time (timestamp) > 'some timestamp pointing to yesterday'

If I have understood it correctly, the planner will recognize the timestamp
and compare it with the statistics in the first example but not in the
second, and thus it will be more likely to use index scan on the first one
and seqscan on the second.

Tobias Brox, +86-13521622905
Nordicbet, IT dept

In response to


pgsql-performance by date

Next:From: Oleg BartunovDate: 2005-06-22 10:53:20
Subject: Re: Forums & tsearch2 - best practices reg. concurrency
Previous:From: Markus WollnyDate: 2005-06-22 09:14:56
Subject: Forums & tsearch2 - best practices reg. concurrency

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