Re: SQL Functions and plan time

From: nolan(at)celery(dot)tssi(dot)com
To: dev(at)archonet(dot)com (Richard Huxton)
Cc: tgl(at)sss(dot)pgh(dot)pa(dot)us (Tom Lane), pgsql-general(at)postgresql(dot)org
Subject: Re: SQL Functions and plan time
Date: 2003-07-08 08:34:13
Message-ID: 20030708083414.14764.qmail@celery.tssi.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Paul Thomas 2003-07-08 08:54:58 Re: Benchmarking
Previous Message mixo 2003-07-08 08:14:49 Benchmarking