Skip site navigation (1) Skip section navigation (2)

Re: cost and actual time

From: Manfred Koizar <mkoi-pg(at)aon(dot)at>
To: Chantal Ackermann <chantal(dot)ackermann(at)biomax(dot)de>
Cc: Josh Berkus <josh(at)agliodbs(dot)com>,pgsql-performance(at)postgresql(dot)org, tgl(at)sss(dot)pgh(dot)pa(dot)us
Subject: Re: cost and actual time
Date: 2003-02-19 10:34:03
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-performance

I'm short of time right now.  So just a few quick notes and a request
for more information.  Next round tomorrow ...

On Wed, 19 Feb 2003 10:38:54 +0100, Chantal Ackermann
<chantal(dot)ackermann(at)biomax(dot)de> wrote:
>yeah, I noticed the difference between the two queries. actually, I am 
>afraid of dropping the distinct cause I had results with duplicate rows 
>(though I shall recheck when this is really the case).  These are the 
>table declarations and constraints: [...]

AFAICS there's no way to get duplicates, so no need for DISTINCT.

> we have to use bigint as type. is the join therefore 
>such expensive?


>we had a primary key occurrence_id on the occurrences tables but we 
>noticed that we don't use it, so we didn't recreate it in the new 
>database. is it possible that the postgres could work with it internally?


> Nested Loop Total runtime:  53508.86 msec
>Merge Join:  Total runtime: 113066.81 msec
>Hash Join:   Total runtime: 439344.44 msec
>I changed the gene name at every run to avoid the caching.

You can't compare the runtimes unless you query for the same data.
Either run each query twice to make sure everything is cached or do
something like
	tar cf /dev/null /some/big/directory
before each query to empty your disk cache.  BTW, what is your
shared_buffers setting.

>disabling the hash join results again in a Nested Loop with very high 
>cost but low runtime - I'm not sure if the latter is the consequence of 

Please send EXPLAIN ANALYZE results for all queries.  Send it to me
off-list if you think its too long.


In response to

pgsql-performance by date

Next:From: Tom LaneDate: 2003-02-19 15:03:41
Subject: Re: Performance Baseline Script
Previous:From: Chantal AckermannDate: 2003-02-19 09:38:54
Subject: Re: cost and actual time

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group