pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruno Wolff III <bruno@wolff.to>
To: kgeis@alum.calberkeley.org
Cc: pgsql-performance@postgresql.org
Subject: Re: bad estimates
Date: Thu, 28 Aug 2003 23:24:53 -0500
Message-ID: <20030829042453.GA5931@wolff.to> (raw)
In-Reply-To: <3F4ED1DC.50808@speakeasy.org>
References: <3F4E99F7.7080604@speakeasy.org>
	<20030829025109.GD4373@wolff.to>
	<3F4EBF7E.8020602@speakeasy.org>
	<20030829030156.GF4373@wolff.to>
	<3F4EC1D0.5010503@speakeasy.org>
	<20030829033818.GA5577@wolff.to>
	<3F4ECC78.7090502@speakeasy.org>
	<20030829040519.GA5746@wolff.to>
	<3F4ED1DC.50808@speakeasy.org>

On Thu, Aug 28, 2003 at 21:09:00 -0700,
  Ken Geis <kgeis@speakeasy.org> wrote:
> Bruno Wolff III wrote:
> 
> I am positive!  I can send a log if you want, but I won't post it to the 
> list.

Can you do a \d on the real table or is that too sensitive?

It still doesn't make sense that you have a primary key that
is a stock and its price. What happens when the stock has the
same price on two different dates? And I doubt that you are looking
for the minimum and maximum dates for which you have price data.
So it is hard to believe that the index for your primary key is the
one you need for your query.

> The arity on the data is roughly 1500 price_dates per stock_id.

Two index scans (one for min values and another for max values)
should be better than one sequential scan under those conditions.

I am calling it quits for tonight, but will check back tomorrow
to see how things turned out.



view thread (25+ messages)  latest in thread

Message-ID: <20030829042453.GA5931@wolff.to>
Permalink:  ../20030829042453.GA5931@wolff.to/
Also on:    postgresql.org/message-id/20030829042453.GA5931@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, kgeis@alum.calberkeley.org
  Subject: Re: bad estimates
  In-Reply-To: <20030829042453.GA5931@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