Re: Sequence vs. Index Scan

From: "Aaron Bono" <postgresql(at)aranya(dot)com>
To: "Andrew Sullivan" <ajs(at)crankycanuck(dot)ca>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Sequence vs. Index Scan
Date: 2007-05-05 22:00:53
Message-ID: bf05e51c0705051500p3e3de711na0d76ae1ad463775@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On 5/5/07, Andrew Sullivan <ajs(at)crankycanuck(dot)ca> wrote:
>
> On Sat, May 05, 2007 at 04:05:52PM -0500, Aaron Bono wrote:
> > I have two schemas, both with the exact same DDL. One performs great
> and
>
> Do they have the same data?

They have different data. The fast one has about 150 rows and the slow one
has about 40 rows. The field in question here, the branch_id, is a
BIGSERIAL in both.

> I have
> > checked and there IS an index, specifically a primary key index, on the
> > branch_id in both schemas so I cannot figure out why the optimizer is
> > looking at these differently. In fact, the table the branch_id comes
> from
> > has the exact same indices and foreign keys on both schemas.
>
> Different data? Different statistics? Different numbers of
> (possibly dead) rows?

We don't allow deletes and updates are fairly infrequent. I also did a
vacuum analyze to no effect.

What can I do to get more statistics that would help?

Thanks for the help,
Aaron

--
==================================================================
Aaron Bono
Aranya Software Technologies, Inc.
http://www.aranya.com
http://codeelixir.com
==================================================================

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2007-05-06 00:22:50 Re: Sequence vs. Index Scan
Previous Message Andrew Sullivan 2007-05-05 21:30:09 Re: Sequence vs. Index Scan