Re: Forcing postgresql to use an index

From: Eugene Morozov <usenet(at)eugenemorozov(dot)name>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: Forcing postgresql to use an index
Date: 2009-09-08 16:00:25
Message-ID: 87eiqh77fq.fsf@eugenemorozov.name
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Grzegorz Jaśkiewicz <gryzman(at)gmail(dot)com> writes:

> Learn it to not generate with "WITH IN (subq)", is this can be quite
> slow on postgresql. Use joins instead.

OK, I've split the query in two (can't make Django to generate JOIN in this
case) and it always uses index now. This immediately opened road for
other optimizations. Thanks!

>
> looks like planner was wrong about rowcount in one place: Hash IN Join
> (cost=2204.80..4809.31 rows=292 width=202) (actual
> time=12.856..283.916 rows=15702 loops=1)
>
> I have no idea why, probably more knowledgeable guys will know more
> about why. But overall, all other stats seem to be okay.
> What's the default_statistics_target setting in the postgresql set to?
>
> One thing tho, what's the version, and platform.

PostgreSQL 8.3.7, Ubuntu 8.10

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Kevin Grittner 2009-09-08 16:30:04 Re: Forcing postgresql to use an index
Previous Message Grzegorz Jaśkiewicz 2009-09-08 15:33:04 Re: Forcing postgresql to use an index