Re: [SQL] JOIN index/sequential select problem

From: gjerde(at)icebox(dot)org
To: pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [SQL] JOIN index/sequential select problem
Date: 1999-05-12 23:00:24
Message-ID: Pine.LNX.4.05.9905121755180.31558-100000@snowman.icebox.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Wed, 12 May 1999, Tom Lane wrote:
> I'm guessing you might be compiling with LOCALE support turned on?

Unfortunately not. I run ./configure --prefix=/home/postgres so that
wouldn't be the case.

> The parser's hack to make LIKE comparisons indexable is only half
> functional in that case, since you get the >= comparison but not the <=
> one. Given the small size of your tables, the optimizer is probably
> estimating that an index scan isn't going to be selective enough to
> justify its extra cost.

Then postgres is not guessing right. Even tho the table only has
~200 rows, the query still takes forever to finish. I have let it go for
a few minutes, and it still wasn't done.. I suppose that would be because
it's doing a seq scan on the inventorysuppliers table for EACH hit in the
av_parts table. That's bound to be slow :)

> FWIW, I do get an index scan plan on an attempt to duplicate this
> case... but I'm not using LOCALE.

Weird. I'll have to look at it more.

Thanks,
Ole Gjerde

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 1999-05-13 00:39:18 Re: [SQL] JOIN index/sequential select problem
Previous Message Tom Lane 1999-05-12 22:56:18 Re: [SQL] JOIN index/sequential select problem