X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id F0878D1B488 for ; Mon, 5 Jan 2004 15:16:21 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 90977-06 for ; Mon, 5 Jan 2004 11:15:35 -0400 (AST) Received: from relay01.kbs.net.au (relay01.kbs.net.au [203.220.32.149]) by svr1.postgresql.org (Postfix) with ESMTP id 3A3DFD1B43D for ; Mon, 5 Jan 2004 11:15:31 -0400 (AST) Received: from [203.221.247.78] (helo=familyhealth.com.au) by relay01.kbs.net.au with esmtp (Exim 3.36 #2) id 1AdWSA-00071I-00; Tue, 06 Jan 2004 02:15:39 +1100 Message-ID: <3FF97F8F.6040305@familyhealth.com.au> Date: Mon, 05 Jan 2004 23:15:27 +0800 From: Christopher Kings-Lynne User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 To: David Teran Cc: Shridhar Daithankar , pgsql-performance@postgresql.org Subject: Re: optimizing Postgres queries References: <4B0023AC-3F72-11D8-B3EB-000A95A6F0DC@cluster9.com> <200401051705.55120.shridhar_daithankar@myrealbox.com> <64C8DBBA-3F77-11D8-A528-000A95A6F0DC@cluster9.com> In-Reply-To: <64C8DBBA-3F77-11D8-A528-000A95A6F0DC@cluster9.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/32 X-Sequence-Number: 5207 > explain analyze SELECT --columns-- FROM KEY_VALUE_META_DATA t0 WHERE > t0.ID_FOREIGN_TABLE = 21110::bigint; > > an index is used. Very fine, the performance is about 10 to 100 times > faster for the single select. An alternative technique is to do this: ... t0.ID_FOREIGN_TABLE = '21110'; Chris