From shyamperi@davlin.co.in Fri Oct 3 07:03:58 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id EB311D1B54A for ; Fri, 3 Oct 2003 07:03:58 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 82304-01 for ; Fri, 3 Oct 2003 04:03:13 -0300 (ADT) Received: from davlin.co.in (ns.vasnet.net.in [202.4.160.11]) by svr1.postgresql.org (Postfix) with ESMTP id 95A7FD1B4F0 for ; Fri, 3 Oct 2003 04:02:55 -0300 (ADT) Received: from staging (unknown [202.4.160.15]) by davlin.co.in (Postfix) with ESMTP id 24B2C14B70 for ; Fri, 3 Oct 2003 12:04:38 +0530 (IST) Message-ID: <6681508.1065164977817.JavaMail.tomcat@mail.davlin.co.in> From: shyamperi@davlin.co.in To: pgsql-performance@postgresql.org Subject: A Basic Question Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_77_5164729.1065164977622" Date: Fri, 3 Oct 2003 12:04:38 +0530 (IST) X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=2.0 tagged_above=0.0 required=5.0 tests=NO_REAL_NAME, RCVD_IN_OSIRUSOFT_COM X-Spam-Level: ** X-Archive-Number: 200310/81 X-Sequence-Number: 3829 ------=_Part_77_5164729.1065164977622 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable 12:28p Dear All, This question is regarding the performance of queries in general. The performance of the queries wud varying depending on the no. Of tuples i= t is returning, and the sort of alogorithm that will be implemented or the = retrieval.=20 Now if the relation returns zero tuples.. (the seq, and the index scan is t= he best option) and if there are 1 or more then rest PG-supported scans wil= l be the best.=20 Now here is where I am having a bit of considerations. My relation works fa= st, when it returns more than on tuple. But get's slow when it returns zero= tuple. Now how shud I got abt it. ----- Warm Regards Sh=FFam Peri II Floor, Punja Building, M.G.Road, Ballalbagh, Mangalore-575003=20 Ph : 91-824-2451001/5 Fax : 91-824-2451050=20 DISCLAIMER: This message contains privileged and confidential information a= nd is intended only for the individual named.If you are not the intended recipient you should not disseminate,distribute,store,print, copy or deliver this message.Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. ------=_Part_77_5164729.1065164977622 Content-type: text/html Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=Untitled1

12:28p
Dear All,

This question is regarding the performance of queries in general.

The performance of the queries wud varying depending on the no. Of tuple= s it is returning, and the sort of alogorithm that will be implemented or t= he retrieval.
Now if the relation returns zero tuples.. (the seq, and t= he index scan is the best option) and if there are 1 or more then rest PG-s= upported scans will be the best.

Now here is where I am having a bit of considerations. My relation works= fast, when it returns more than on tuple. But get's slow when it returns z= ero tuple.

Now how shud I got abt it.

-----
Warm Regards
Sh=FFam Peri

II Floor, Punja Building,
M.G.Road,
Ballalbagh,
Mangalore-575003=20
Ph : 91-824-2451001/5
Fax : 91-824-2451050=20




DISCLAIMER: This message contains privileged and confidential information a= nd is intended only for the individual named.If you are not the intended recipient you should not disseminate,distribute,store,print, copy or deliver this message.Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. ------=_Part_77_5164729.1065164977622-- From dev@archonet.com Fri Oct 3 10:11:14 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id BBD1CD1B54C for ; Fri, 3 Oct 2003 10:11:14 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 08824-10 for ; Fri, 3 Oct 2003 07:10:28 -0300 (ADT) Received: from anchor-post-37.mail.demon.net (anchor-post-37.mail.demon.net [194.217.242.87]) by svr1.postgresql.org (Postfix) with ESMTP id 7B79ED1B51A for ; Fri, 3 Oct 2003 07:10:25 -0300 (ADT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-37.mail.demon.net with esmtp (Exim 3.35 #1) id 1A5MtH-0004w2-0b; Fri, 03 Oct 2003 11:10:27 +0100 Received: from localhost (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with ESMTP id 4A31C17183; Fri, 3 Oct 2003 11:10:26 +0100 (BST) Received: from client17.archonet.com (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id 9F1FE1717B; Fri, 3 Oct 2003 11:10:25 +0100 (BST) From: Richard Huxton To: shyamperi@davlin.co.in, pgsql-performance@postgresql.org Subject: Re: A Basic Question Date: Fri, 3 Oct 2003 11:10:25 +0100 User-Agent: KMail/1.5 References: <6681508.1065164977817.JavaMail.tomcat@mail.davlin.co.in> In-Reply-To: <6681508.1065164977817.JavaMail.tomcat@mail.davlin.co.in> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200310031110.25776.dev@archonet.com> X-Virus-Scanned: by AMaViS snapshot-20020531 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/82 X-Sequence-Number: 3830 On Friday 03 October 2003 07:34, shyamperi@davlin.co.in wrote: > 12:28p > Dear All, > This question is regarding the performance of queries in general. > The performance of the queries wud varying depending on the no. Of tuples > it is returning, and the sort of alogorithm that will be implemented or the > retrieval. Now if the relation returns zero tuples.. (the seq, and the > index scan is the best option) and if there are 1 or more then rest > PG-supported scans will be the best. Now here is where I am having a bit of > considerations. My relation works fast, when it returns more than on tuple. > But get's slow when it returns zero tuple. Now how shud I got abt it. If PG has to examine a lot of tuples to rule them out, then returning no rows can take longer. If you post EXPLAIN ANALYSE output for both queries, someone will be able to explain why in your case. -- Richard Huxton Archonet Ltd