From: Tambet Matiisen <tambet.matiisen@mail.ee>
To: Tambet Matiisen <t.matiisen@aprote.ee>
To: pgsql-sql@postgresql.org
To: Rafal Kedziorski <rafcio@polonium.de>
Subject: Re: good style?
Date: Tue, 25 Feb 2003 08:42:09 +0200
Message-ID: <002601c2dc99$056ef520$0100a8c0@kodunet.ee> (raw)
References: <5.2.0.9.0.20030224004643.01b21e08@mail.polonium.de>
----- Original Message -----
From: "Rafal Kedziorski" <rafcio@polonium.de>
To: "Tambet Matiisen" <t.matiisen@aprote.ee>; <pgsql-sql@postgresql.org>
Sent: Monday, February 24, 2003 1:51 AM
Subject: Re: [SQL] good style?
> [snip]
>
>
> original:
>
> Merge Join (cost=728.47..820.47 rows=1000 width=366)
> ...
>
>
> 1st join:
> Merge Join (cost=3042.29..3184.29 rows=5000 width=366)
> ...
>
>
> 2nd join:
> Merge Join (cost=3042.29..3184.29 rows=5000 width=366)
> ...
>
>
> have I post thic correctly using JOIN?
>
>
Optimizer expects the original query to return 1000 rows, while others are
expected to return 5000 rows. I compared the original query with others, but
didn't see any difference at first sight. I don't know, if the expected row
count depends on execution path in Postgres. You can look at explain output
of original query and imitate the join order chosen by optimizer by JOINs,
and then compare costs.
What are the real-world timings? And do these queries actually return the
same result? If you calculate cost for fetching one row, then 3184,29 / 5000
= 0,636858, while 820.47 / 1000 = 0,82047. So maybe it's not that bad at
all.
Tambet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tambet.matiisen@mail.ee, t.matiisen@aprote.ee, rafcio@polonium.de
Subject: Re: good style?
In-Reply-To: <002601c2dc99$056ef520$0100a8c0@kodunet.ee>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox