From: Stefan Kaltenbrunner <stefan@kaltenbrunner.cc>
To: tarcizioab@c3sl.ufpr.br
Cc: pgsql-performance@postgresql.org
Subject: Re: Explain Analyze - Total runtime very differentes
Date: Sun, 19 Oct 2008 10:55:50 +0200
Message-ID: <48FAF616.4040005@kaltenbrunner.cc> (raw)
In-Reply-To: <50397.200.140.234.93.1224357249.squirrel@webmail.inf.ufpr.br>
References: <50397.200.140.234.93.1224357249.squirrel@webmail.inf.ufpr.br>
tarcizioab@c3sl.ufpr.br wrote:
> Hello friends ...
>
> I'm evaluating the performance of algorithms for optimization of queries.
> I am comparing results between the algorithm of Dynamic Programming and an
> implementation of Kruskal's algorithm. When submitting a query that makes
> reference to only 2 tables of my base, logically the same "Query Plan" is
> shown. But the "Total runtime" displayed by the command "Explain-Analyze"
> presents a variation of time very high:
>
> Dynamic Programming Total runtime: 1204.220 ms
>
> Kruskal Total runtime: 3744.879 ms
>
> No change of data (insert, delete, update) in the tables was made during
> the tests. The same query was submitted several times (with Kruskal and
> Dynamic Programming algorithms) and the variation of results persists.
>
> The "explain analyze" only reports the time to run *execute* the query.
> With the same "Query Plan", does not understand why this variation occurs.
>
> In annex the Query Plans
sure it it not something as simple as a caching effect - ie you run the
slow variant first and pg and/or the OS buffered data and the repeated
execution just got a benefit from that ?
Try running all variations a few dozend times both in cached and
uncached state and you should see the difference getting leveled out.
Stefan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: stefan@kaltenbrunner.cc, tarcizioab@c3sl.ufpr.br
Subject: Re: Explain Analyze - Total runtime very differentes
In-Reply-To: <48FAF616.4040005@kaltenbrunner.cc>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox