Re: Optimizer's issue

From: Matthew Wakeling <matthew(at)flymine(dot)org>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: Optimizer's issue
Date: 2008-04-24 10:50:24
Message-ID: Pine.LNX.4.64.0804241140170.13221@aragorn.flymine.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Thu, 24 Apr 2008, Vlad Arkhipov wrote:
> It was written below in my first post:
> "These queries are part of big query and optimizer put them on the leaf
> of query tree, so rows miscount causes a real problem. "
> actual rows count for the first query is 294, estimate - 11; for the
> second -- 283 and 0. Postgres tries to use nested loops when it should
> use merge/hash join and vice versa.

The queries are taking less than three milliseconds. You only have three
hundred rows in each table. The precise algorithm Postgres uses probably
won't make much of a difference. Have you tried turning off the relevant
join plans to see how long Postgres takes with your desired plan?

When you have millions of rows, the algorithm matters a lot more.

Matthew

--
Richards' Laws of Data Security:
1. Don't buy a computer.
2. If you must buy a computer, don't turn it on.

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Gregory Stark 2008-04-24 11:31:42 Re: off-topic: SPAM
Previous Message Vlad Arkhipov 2008-04-24 09:47:37 Re: Optimizer's issue