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

explain analyze results are different for each iteration

From: Robert Davis <robert(at)faithwestinc(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: explain analyze results are different for each iteration
Date: 2004-09-15 01:21:27
Message-ID: 41479917.7010305@faithwestinc.com (view raw or flat)
Thread:
Lists: pgsql-sql
I'm trying to benchmark some complex sql queries.  One query, in 
particular, is causing problems -- its cost values can vary from 228 
to 907, its Total Runtimes from 60 ms to 5176 ms.  The query plans 
show that the optimizer is choosing different plans for different 
iterations of the same query.  Does anyone have any idea what's 
going on here or maybe how I can force Postgres to prefer the faster 
plan?

The query plans are very long (11 tables joined) but I can include 
them if it might help.  Thanks for any advice,

Roberto

Responses

pgsql-sql by date

Next:From: Gregory S. WilliamsonDate: 2004-09-15 01:33:11
Subject: Re: explain analyze results are different for each iteration
Previous:From: Alvaro Nunes MeloDate: 2004-09-13 22:03:03
Subject: Difficulties to use a Set Returning Function on a join

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