Skip site navigation (1) Skip section navigation (2)

Re: Postgres 8.3 only uses seq scan

From: Clemens Schwaighofer <clemens(dot)schwaighofer(at)tequila(dot)jp>
To: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Postgres 8.3 only uses seq scan
Date: 2008-11-26 06:28:20
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general
On 11/26/2008 03:20 PM, Scott Marlowe wrote:
> On Tue, Nov 25, 2008 at 10:22 PM, Clemens Schwaighofer
> <clemens(dot)schwaighofer(at)tequila(dot)jp> wrote:
>> On 11/26/2008 02:15 PM, Scott Marlowe wrote:
>>> Are there more rows in the 8.2 table you're testing on?  Or is the
>>> whole table small enough to fit on a few pages?
>> I highly doubt that. I have right now in one of the DBs I transfered
>> tables from ~100.000 down to ~40.000 rows that all join together. I
>> somehow really doubt that fit in a few pages.
> Right, with more rows, and choosing fewer, pgsql will go for an index
> scan.  if choosing a good %, the seq scan.

okay, then I think I get it. One of my test queries was actually
selecting a very big chunk (90%) of the data, so it makes sense the
planner chooses seq scan over index scan here.

>> So, I am fine when I trust the Postgresql planner :) Because speed wise
>> I see no difference that 8.3 would be slower than 8.2
> Well, the planner's not perfect.  Some off corner cases can catch it
> out, or if your database isn't analyzed after a lot of changes it may
> make an uninformed decision.  But most the time it makes the right, or
> close enough, decision.

Well, I have autovacuum turned on, so this should hopefully keep the
planner up to date.

Anyway, thanks a lot for your help.

[ Clemens Schwaighofer                      -----=====:::::~ ]
[ IT Engineer/Manager                                        ]
[ E-Graphics Communications, TEQUILA\ Japan IT Group         ]
[                6-17-2 Ginza Chuo-ku, Tokyo 104-8167, JAPAN ]
[ Tel: +81-(0)3-3545-7706            Fax: +81-(0)3-3545-7343 ]
[                                      ]

In response to

pgsql-general by date

Next:From: Mikko PartioDate: 2008-11-26 06:33:46
Subject: Re: two or more pg installations running as the same user
Previous:From: Scott MarloweDate: 2008-11-26 06:20:56
Subject: Re: Postgres 8.3 only uses seq scan

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group