Re: SQL Functions and plan time - Mailing list pgsql-general

From nolan@celery.tssi.com
Subject Re: SQL Functions and plan time
Date
Msg-id 20030708083414.14764.qmail@celery.tssi.com
Whole thread Raw
In response to Re: SQL Functions and plan time  (Richard Huxton <dev@archonet.com>)
Responses Re: SQL Functions and plan time  (Richard Huxton <dev@archonet.com>)
List pgsql-general
> So why am I getting substantially different times for identical queries
> (except for parameter substitution)

This sounds like the question I asked two weeks ago.

What I concluded was that though they may be identical queries, they are
not identical in terms of what happens when you execute them.

Why?  Because the tuples have been updated, meaning that the affected
rows are in different physical locations than they used to be in both
the table and in any indexes.

Imagine that you have to pick up 10 items at the grocery store.  You
have a list of which aisles they're in.  Tomorrow you go back
to the store to pick up the same 10 items.  However, overnight the
store has moved them all to different locations.  Even though you have
an updated list, it will likely take you a different amount of time
to pick up those 10 items.

Running a vacuum analyze and rebuilding indexes between runs should
produce more consistent timings, if consistent timings are important.

Readonly queries running on an otherwise idle server should produce
more consistent timings, subject to caching issues.
--
Mike Nolan

pgsql-general by date:

Previous
From: mixo
Date:
Subject: Benchmarking
Next
From: Paul Thomas
Date:
Subject: Re: Benchmarking