Re: Query Performance Test

From: Lew <lew(at)lwsc(dot)ehost-services(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Query Performance Test
Date: 2007-11-15 14:20:42
Message-ID: LpednRPRWZInyKHanZ2dnUVZ_sSlnZ2d@comcast.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

dcrespo wrote:
> I have a query that I want to test twice to see its performance with
> and without another program running (anti-virus program). I know that
> if you run the same query for the second time, it will be faster than
> the first time. So, how can I do to execute it as if it was the first
> time again?

In the first place, you cannot make a valid trend line with one data point.

Don't compare the first run. Compare the nth runs in both cases, where n >
some positive integer.

To get statistical confidence, you should measure k runs starting at run n.

Example: Profile runs [4, 13]. n = 4, k = 10.

(Statistics trick: acquire (k+2) samples for each scenario, throw away the
largest and smallest measurements, analyze the remaining k values.)

PG has optimized the query in both scenarios, so you are rendering the PG
aspect constant. Report both the mean and the standard deviation of your k
runs. Compare with and without anti-virus running.

How much control do you have over the test machine's operating profile, i.e.,
what services and background tasks are running, network I/O, other factors
that can influence timing?

--
Lew

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Albe Laurenz 2007-11-15 14:31:08 Re: Enforcing Join condition
Previous Message சிவகுமார் மா 2007-11-15 14:19:18 Re: Enforcing Join condition