pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Edoardo Ceccarelli <eddy@expot.it>
To: pgsql-performance@postgresql.org
Cc: pgsql-admin@postgresql.org
Subject: finding a max value
Date: Fri, 02 Jul 2004 20:50:26 +0200
Message-ID: <40E5AE72.1080206@expot.it> (raw)
In-Reply-To: <20040702131258.GB25007@wolff.to>
References: <20040702075007.B448FCF4D52@www.postgresql.com>
	<20040702131258.GB25007@wolff.to>

This is the query:
select max(KA) from annuncio

field KA is indexed and is int4,

explaining gives:
explain select max(KA) from annuncio;
QUERY PLAN
-----------------------------------------------------------------------
Aggregate (cost=21173.70..21173.70 rows=1 width=4)
-> Seq Scan on annuncio (cost=0.00..20326.76 rows=338776 width=4)
(2 rows)


wasn't supposed to do an index scan? it takes about 1sec to get the result.



view thread (3+ messages)  latest in thread

Message-ID: <40E5AE72.1080206@expot.it>
Permalink:  ../40E5AE72.1080206@expot.it/
Also on:    postgresql.org/message-id/40E5AE72.1080206@expot.it

 · 

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: eddy@expot.it, pgsql-admin@postgresql.org
  Subject: Re: finding a max value
  In-Reply-To: <40E5AE72.1080206@expot.it>

* 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