pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephan Szabo <sszabo@megazone23.bigpanda.com>
To: Marcos Garcia <marcos-p-garcia@ptinovacao.pt>
Cc: pgsql-sql <pgsql-sql@postgresql.org>
Subject: Re: Slow SELECT with distinct, in a TIMESTAMP type column
Date: Mon, 24 Jun 2002 14:06:00 -0700 (PDT)
Message-ID: <20020624140056.B59376-100000@megazone23.bigpanda.com> (raw)
In-Reply-To: <1024947975.1035.648.camel@sargao>

On 24 Jun 2002, Marcos Garcia wrote:

>
> When i make the set enable_seqscan = off the result is:
>
> dbname=# set enable_seqscan = off;
> SET VARIABLE
> dbname=# explain analyze SELECT distinct(smsdate) FROM send_total;
>
> NOTICE:  QUERY PLAN:
>
> Unique  (cost=0.00..31084.39 rows=1232 width=8) (actual
> time=108.60..195210.91 rows=6676 loops=1)
>   ->  Index Scan using send_total_smsdate_idx on send_total
> (cost=0.00..31053.60 rows=12315 width=8) (actual time=108.59..195145.43
> rows=12087 loops=1)
> Total runtime: 195226.24 msec

Well the plan choice makes sense (since it's about 3.5x faster as
a sequence scan over the index scan).
It looks like most of the time is taken up by the actual scan (is
"select smsdate from send_total" pretty much as slow?).






view thread (4+ messages)

Message-ID: <20020624140056.B59376-100000@megazone23.bigpanda.com>
Permalink:  ../20020624140056.B59376-100000@megazone23.bigpanda.com/
Also on:    postgresql.org/message-id/20020624140056.B59376-100000@megazone23.bigpanda.com

 · 

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-sql@postgresql.org
  Cc: sszabo@megazone23.bigpanda.com, marcos-p-garcia@ptinovacao.pt
  Subject: Re: Slow SELECT with distinct, in a TIMESTAMP type column
  In-Reply-To: <20020624140056.B59376-100000@megazone23.bigpanda.com>

* 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