Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id D74892E005C for ; Wed, 9 Apr 2008 07:04:17 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 15413-06 for ; Wed, 9 Apr 2008 07:04:07 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from yw-out-2324.google.com (yw-out-2324.google.com [74.125.46.28]) by developer.postgresql.org (Postfix) with ESMTP id 7CFF62E005E for ; Wed, 9 Apr 2008 07:04:08 -0300 (ADT) Received: by yw-out-2324.google.com with SMTP id 2so521341ywt.73 for ; Wed, 09 Apr 2008 03:04:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=DW5WZeGVQH0PxT7JzipBZDfv3+JzDrLDkW9+qVy9vT8=; b=DL2r3ol/B1RiWPZ1HaA4uDyyv/1MYLDKV2Xy5JBUyzkNLWKKgKkxrxh+WNcwL8vqSDOtU8VGlURIuyQAs1Q40lYuSPeAmebG1QeJ+yOS/x76LoGpbGSjud5ZFi6DMg4b5lkN4pAQnU7+rJ+fnk9xGrOvBEDvfMSjwiWb4FJNmfk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=i69wSAn3SOrjuZqLo95cgRvfsLQVvTFHrVkUBb6kuy8nOJKUFwdbintQWb5/oG6sIiLqDtkCFOmKkVCxf7k9iKx6sU7ajuCbBqPDCDL+RTbMTlv9U4F5bQNEhKEHXzXqwOmzKqkIOQ2YkTsPE1z066VGlBCzjsGSToWJs2Sk9fM= Received: by 10.150.136.6 with SMTP id j6mr54025ybd.117.1207735446454; Wed, 09 Apr 2008 03:04:06 -0700 (PDT) Received: by 10.150.97.21 with HTTP; Wed, 9 Apr 2008 03:04:06 -0700 (PDT) Message-ID: <2e78013d0804090304l611044d6q4a71a927ec199b65@mail.gmail.com> Date: Wed, 9 Apr 2008 15:34:06 +0530 From: "Pavan Deolasee" To: "Luigi N. Puleio" Subject: Re: EXPLAIN detail Cc: pgsql-performance@postgresql.org In-Reply-To: <862313.90586.qm@web33505.mail.mud.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <862313.90586.qm@web33505.mail.mud.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200804/99 X-Sequence-Number: 29592 On Wed, Apr 9, 2008 at 3:21 PM, Luigi N. Puleio wrote: > Hello everyone!! > > I have a table with 17 columns and it has almost > 530000 records and doing just a > > SELECT * FROM table > > with the EXPLAIN ANALYZE I get: > > Seq Scan on table (cost=0.00...19452.95 rows=529395 > width=170) (actual time=0.155...2194.294 rows=529395 > loops=1) > total runtime=3679.039 ms > > and this table has a PK... > Do you think is too much time for a simple select?... > Well, PK won't help you here because you are selecting all rows from the table and that seq scan is the right thing for that. Without knowing your hardware its difficult to judge if the time taken is more or not. Anyways, I don't think there is much tweaking you can do for such a query except making sure that your table is not bloated with dead tuples. Thanks, Pavan -- Pavan Deolasee EnterpriseDB http://www.enterprisedb.com