pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Giorgio Valoti <giorgio_v@mac.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Query Plan choice with timestamps
Date: Thu, 07 Aug 2008 11:50:59 -0400
Message-ID: <12707.1218124259@sss.pgh.pa.us> (raw)
In-Reply-To: <321506D5-4400-470C-909E-C7700D49A540@mac.com>
References: <321506D5-4400-470C-909E-C7700D49A540@mac.com>

Giorgio Valoti <giorgio_v@mac.com> writes:
>   GroupAggregate  (cost=98431.58..119773.92 rows=74226 width=8)
>     ->  Sort  (cost=98431.58..99050.92 rows=247736 width=8)
>           Sort Key: (day_trunc(ts))
>           ->  Seq Scan on blackbox  (cost=0.00..72848.36 rows=247736 width=8)

>   GroupAggregate  (cost=0.00..19109.66 rows=74226 width=8)
>     ->  Index Scan using test_2_idx on blackbox  (cost=0.00..16943.16 rows=247736 width=8)

These numbers seem pretty bogus: there is hardly any scenario in which a
full-table indexscan should be costed as significantly cheaper than a
seqscan.  Have you put in silly values for random_page_cost?

If you haven't mucked with the cost parameters, the only way I can think
of to get this result is to have an enormously bloated table that's
mostly empty.  Maybe you need to review your vacuuming procedures.

			regards, tom lane



view thread (10+ messages)  latest in thread

Message-ID: <12707.1218124259@sss.pgh.pa.us>
Permalink:  ../12707.1218124259@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/12707.1218124259@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, giorgio_v@mac.com
  Subject: Re: Query Plan choice with timestamps
  In-Reply-To: <12707.1218124259@sss.pgh.pa.us>

* 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