Re: How to optimize monstrous query, sorts instead of

From: Rod Taylor <rbt(at)rbt(dot)ca>
To: Ang Chin Han <angch(at)bytecraft(dot)com(dot)my>
Cc: michael(dot)mattox(at)verideon(dot)com, Postgresql Performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: How to optimize monstrous query, sorts instead of
Date: 2003-07-03 12:26:13
Message-ID: 1057235173.30368.32.camel@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

> CREATE VIEW foo AS {complex_slow_query};
>
> SET random_page_cost = 1.5; EXPLAIN ANALYZE SELECT * FROM foo;
>
> Note the time taken. Repeat a few times to get the average.

You pulled everything off disk and tossed it into memory with the first
run so the results will NOT match your normal situation (some data on
disk, some cached in memory) for your second run and further runs unless
there is a LONG timeframe between runs.

That said, if you test with several other queries and get the same
results, it's probably good enough for your system.

Browse pgsql-performance by date

  From Date Subject
Next Message Sean Chittenden 2003-07-03 19:05:02 Moving postgresql.conf tunables into 2003...
Previous Message Paul Thomas 2003-07-03 08:47:44 Re: raise or lower transaction timeout?