X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 3AE95DB09A for ; Thu, 27 Oct 2005 13:29:34 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 12304-08 for ; Thu, 27 Oct 2005 16:29:25 +0000 (GMT) Received: from wolff.to (wolff.to [66.93.197.194]) by svr1.postgresql.org (Postfix) with SMTP id BFE65D8BE1 for ; Thu, 27 Oct 2005 13:29:24 -0300 (ADT) Received: (qmail 15555 invoked by uid 500); 27 Oct 2005 16:31:10 -0000 Date: Thu, 27 Oct 2005 11:31:10 -0500 From: Bruno Wolff III To: Abdul Wahab Dahalan Cc: pgsql-sql@postgresql.org Subject: Re: How to speed up the database query? Message-ID: <20051027163110.GB11072@wolff.to> Mail-Followup-To: Bruno Wolff III , Abdul Wahab Dahalan , pgsql-sql@postgresql.org References: <5076660.1130396616478.SLOX.WebMail.wwwrun@openx.mimos.my> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5076660.1130396616478.SLOX.WebMail.wwwrun@openx.mimos.my> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 required=5 tests=[AWL=0.006] X-Spam-Level: X-Archive-Number: 200510/371 X-Sequence-Number: 23224 On Thu, Oct 27, 2005 at 15:03:36 +0800, Abdul Wahab Dahalan wrote: > Hi everyone! > > I'm looking for solution to speed up the database query, means that to get resultset as quicker as we can. > > For example if I've 700 records in the table it will take longer time compared if I've only 20 records. How do we speed up the query?. Any query technique that can be applied?. > > Thus wild card query like : select * from tableA will cause query time increased compare to say select a,b from tableA. > > any help, prettymuch appreciated. Why don't you run explain analyze on the real query you are trying to speed up and show us the output along with the query and relevant table and view definitions. Yes, specifying fewer columns will probably significantly speed things up, as you will be transmitting less data over the network. There aren't magic ways to speed up queries return every row in a table.