pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David M. Richter <David.M.Richter@freenet.de>
Cc: pgsql-sql@postgresql.org
Subject: Re: Query optimizing - paradox behave
Date: Fri, 20 Jul 2001 13:05:16 -0400
Message-ID: <4085.995648716@sss.pgh.pa.us> (raw)
In-Reply-To: <3B57F09E.C807E20A@freenet.de>
References: <3B57F09E.C807E20A@freenet.de>

"David M. Richter" <David.M.Richter@freenet.de> writes:
> The query with the 3 tables is faster than the query with 2 tables. 

How you figure that?

> time psql -d compare -c "SELECT patient.*,study.* FROM
> patient,study,relpatient_study000 r0 WHERE
> (patient.chiliOID=r0.parentOID AND study.chiliOID=r0.childOID) order by
> patient.name using <" > 3tableni
> 1.671u 0.130s 0:11.14 16.4%     0+0k 0+0io 208pf+0w

> time psql -d pacs -c "SELECT patient.*,study.* FROM patient,study WHERE
> (patient.chiliOID=study.patientOID ) order by patient.name using <" >
> 2tableni
> 1.730u 0.120s 0:09.44 19.5%     0+0k 0+0io 208pf+0w

9.44 vs 11.14 seconds looks like a clear advantage for the second query
to me...

			regards, tom lane



view thread (7+ messages)  latest in thread

Message-ID: <4085.995648716@sss.pgh.pa.us>
Permalink:  ../4085.995648716@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/4085.995648716@sss.pgh.pa.us

 · 

reply

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: tgl@sss.pgh.pa.us, David.M.Richter@freenet.de
  Subject: Re: Query optimizing - paradox behave
  In-Reply-To: <4085.995648716@sss.pgh.pa.us>

* 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