pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruno Wolff III <bruno@wolff.to>
To: Pierre-Frédéric Caillaud <lists@boutiquenumerique.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Why does a simple query not use an obvious index?
Date: Mon, 30 Aug 2004 14:40:50 -0500
Message-ID: <20040830194050.GA1862@wolff.to> (raw)
In-Reply-To: <opsdj710chcq72hf@musicbox>
References: <ENEIKKAEJOFHOIHMMOIDIEBMJCAA.jack.kerkhof@guest-tek.com>
	<1093804128.5493.22.camel@localhost.localdomain>
	<87fz65k5sq.fsf@stark.xeocode.com>
	<opsdj710chcq72hf@musicbox>

On Mon, Aug 30, 2004 at 21:21:26 +0200,
  Pierre-Frédéric Caillaud <lists@boutiquenumerique.com> wrote:
> >>Also, count(*) is likely to always generate a seq scan due to the way
> >>aggregates are implemented currently in pgsql.  you might want to try:
> 
> 
> 	By the way, in an ideal world, count(*) should only read the index 
> 	on the  timetamp column, not the rows. I guess this is not the case. Would 
> this be  an useful optimization ?

It's in the archives. The short answer is that no, postgres has to check
the heap to check tuple visibility to the current transaction.



view thread (28+ messages)  latest in thread

Message-ID: <20040830194050.GA1862@wolff.to>
Permalink:  ../20040830194050.GA1862@wolff.to/
Also on:    postgresql.org/message-id/20040830194050.GA1862@wolff.to

 · 

reply

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: bruno@wolff.to, lists@boutiquenumerique.com
  Subject: Re: Why does a simple query not use an obvious index?
  In-Reply-To: <20040830194050.GA1862@wolff.to>

* 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