From shaiju.ck@gmail.com Mon Nov 8 06:36:30 2010 Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 246DE1337990 for ; Mon, 8 Nov 2010 02:36:30 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 52541-08 for ; Mon, 8 Nov 2010 06:36:22 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from kuber.nabble.com (kuber.nabble.com [216.139.236.158]) by mail.postgresql.org (Postfix) with ESMTP id A1B99133729E for ; Mon, 8 Nov 2010 02:36:22 -0400 (AST) Received: from sam.nabble.com ([192.168.236.26]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1PFL2G-0005xs-F6 for pgsql-performance@postgresql.org; Sun, 07 Nov 2010 22:16:56 -0800 Date: Sun, 7 Nov 2010 22:16:56 -0800 (PST) From: "shaiju.ck" To: pgsql-performance@postgresql.org Message-ID: <1289197016462-3254568.post@n5.nabble.com> Subject: Select * is very slow MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_22848_17781059.1289197016461" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.777 tagged_above=-10 required=5 tests=BAYES_00=-1.9, HTML_MESSAGE=0.001, URI_HEX=1.122 X-Spam-Level: X-Archive-Number: 201011/100 X-Sequence-Number: 41124 ------=_Part_22848_17781059.1289197016461 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi, I have a table employee with 33 columns. The table have 200 records now. Select * from employee takes 15 seconds to fetch the data!!! Which seems to be very slow. But when I say select id,name from empoyee it executes in 30ms. Same pefromance if I say select count(*) from emloyee. Why the query is slow if I included all the columns in the table. As per my understanding , number of columns should not be having a major impact on the query performance. I have increased the shared_buffres to 1024MB, but no improvement. I have noticed that the query "show shared_buffers" always show 8MB.Why is this? Does it mean that changing the shared_buffers in config file have no impact? Can anybody help? Shaiju -- View this message in context: http://postgresql.1045698.n5.nabble.com/Select-is-very-slow-tp3254568p3254568.html Sent from the PostgreSQL - performance mailing list archive at Nabble.com. ------=_Part_22848_17781059.1289197016461 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit Hi, I have a table employee with 33 columns. The table have 200 records now. Select * from employee takes 15 seconds to fetch the data!!! Which seems to be very slow. But when I say select id,name from empoyee it executes in 30ms. Same pefromance if I say select count(*) from emloyee. Why the query is slow if I included all the columns in the table. As per my understanding , number of columns should not be having a major impact on the query performance. I have increased the shared_buffres to 1024MB, but no improvement. I have noticed that the query "show shared_buffers" always show 8MB.Why is this? Does it mean that changing the shared_buffers in config file have no impact? Can anybody help? Shaiju

View this message in context: Select * is very slow
Sent from the PostgreSQL - performance mailing list archive at Nabble.com.
------=_Part_22848_17781059.1289197016461-- From pavel.stehule@gmail.com Mon Nov 8 15:24:23 2010 Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 7B3921337B97 for ; Mon, 8 Nov 2010 11:24:23 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 92621-07 for ; Mon, 8 Nov 2010 15:24:16 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-gx0-f174.google.com (mail-gx0-f174.google.com [209.85.161.174]) by mail.postgresql.org (Postfix) with ESMTP id 58AE11337B98 for ; Mon, 8 Nov 2010 11:24:14 -0400 (AST) Received: by gxk23 with SMTP id 23so3413935gxk.19 for ; Mon, 08 Nov 2010 07:24:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type; bh=WPUppvNlntTelF47xsstbfrqsoapBuj1ymljuTfWftw=; b=sFAodYMDvRNoZzSUDTHNtFenzV5J5xzZNOpW8JcyLtET6rwfuqPZlIEedA0U75LtTj AOR82KB4jN3LberoU/RrdZxC0nuQXMXYcw092GwFgGiTAOm8ThNdEVEUDayfINnzjSLc o6KuwxmlfkdayDoGLWumXyKpg6HNdNPs6iQKg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=wc2MOQSIeGCr24RvK/4MdIRq1ISgvQhUAezCLBlj7blsjJzhQhWa/agq2QgNxyjCgI TNnZ8MKOBfxxV4j5UzSO2uUOaE9hsGaP8Q23/M03QA3+4j2CtKoac40LqDeiTU1l49PV qKmmfvfC+z35QS1xnYxTDYLPlbTq5V6fjzM40= Received: by 10.42.228.8 with SMTP id jc8mr3691375icb.86.1289229853229; Mon, 08 Nov 2010 07:24:13 -0800 (PST) MIME-Version: 1.0 Received: by 10.42.179.6 with HTTP; Mon, 8 Nov 2010 07:23:32 -0800 (PST) In-Reply-To: <1289197016462-3254568.post@n5.nabble.com> References: <1289197016462-3254568.post@n5.nabble.com> From: Pavel Stehule Date: Mon, 8 Nov 2010 16:23:32 +0100 Message-ID: Subject: Re: Select * is very slow To: "shaiju.ck" Cc: pgsql-performance@postgresql.org Content-Type: text/plain; charset=UTF-8 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201011/101 X-Sequence-Number: 41125 Hello do you use a VACUUM statement? Regards Pavel Stehule 2010/11/8 shaiju.ck : > Hi, I have a table employee with 33 columns. The table have 200 records now. > Select * from employee takes 15 seconds to fetch the data!!! Which seems to > be very slow. But when I say select id,name from empoyee it executes in > 30ms. Same pefromance if I say select count(*) from emloyee. Why the query > is slow if I included all the columns in the table. As per my understanding > , number of columns should not be having a major impact on the query > performance. I have increased the shared_buffres to 1024MB, but no > improvement. I have noticed that the query "show shared_buffers" always show > 8MB.Why is this? Does it mean that changing the shared_buffers in config > file have no impact? Can anybody help? Shaiju > ________________________________ > View this message in context: Select * is very slow > Sent from the PostgreSQL - performance mailing list archive at Nabble.com. > From thom@linux.com Mon Nov 8 15:31:56 2010 Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id DD0CE1337BB1 for ; Mon, 8 Nov 2010 11:31:56 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 98624-05-2 for ; Mon, 8 Nov 2010 15:31:50 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp1.linux-foundation.org (smtp1.linux-foundation.org [140.211.169.13]) by mail.postgresql.org (Postfix) with ESMTP id 617A91337B93 for ; Mon, 8 Nov 2010 11:31:45 -0400 (AST) Received: from mail-pz0-f46.google.com (mail-pz0-f46.google.com [209.85.210.46]) (authenticated bits=0) by smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with ESMTP id oA8FV51W021937 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=FAIL) for ; Mon, 8 Nov 2010 07:31:14 -0800 Received: by pzk28 with SMTP id 28so860895pzk.19 for ; Mon, 08 Nov 2010 07:31:00 -0800 (PST) Received: by 10.42.151.7 with SMTP id c7mr3439523icw.9.1289230260322; Mon, 08 Nov 2010 07:31:00 -0800 (PST) MIME-Version: 1.0 Received: by 10.231.0.218 with HTTP; Mon, 8 Nov 2010 07:30:30 -0800 (PST) In-Reply-To: <1289197016462-3254568.post@n5.nabble.com> References: <1289197016462-3254568.post@n5.nabble.com> From: Thom Brown Date: Mon, 8 Nov 2010 15:30:30 +0000 Message-ID: Subject: Re: Select * is very slow To: "shaiju.ck" Cc: pgsql-performance@postgresql.org Content-Type: multipart/alternative; boundary=90e6ba613af0b340af04948c4f46 X-MIMEDefang-Filter: lf$Revision: 1.188 $ X-Scanned-By: MIMEDefang 2.63 on 140.211.169.13 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.899 tagged_above=-10 required=5 tests=BAYES_00=-1.9, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201011/102 X-Sequence-Number: 41126 --90e6ba613af0b340af04948c4f46 Content-Type: text/plain; charset=ISO-8859-1 On 8 November 2010 06:16, shaiju.ck wrote: > Hi, I have a table employee with 33 columns. The table have 200 records > now. Select * from employee takes 15 seconds to fetch the data!!! Which > seems to be very slow. But when I say select id,name from empoyee it > executes in 30ms. Same pefromance if I say select count(*) from emloyee. Why > the query is slow if I included all the columns in the table. As per my > understanding , number of columns should not be having a major impact on the > query performance. I have increased the shared_buffres to 1024MB, but no > improvement. I have noticed that the query "show shared_buffers" always show > 8MB.Why is this? Does it mean that changing the shared_buffers in config > file have no impact? Can anybody help? Shaiju > Could you run an EXPLAIN ANALYZE on the query? And what do the columns contain? For instance, if you have 10 columns each returning massive XML documents, each hundreds of megs, the bottleneck would be I/O bandwidth. -- Thom Brown Twitter: @darkixion IRC (freenode): dark_ixion Registered Linux user: #516935 --90e6ba613af0b340af04948c4f46 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On 8 November 2010 06:16, shaiju.ck <sha= iju.ck@gmail.com> wrote:
=
Hi, I have a table employee with 33 columns. The table have 200 records now. Select * from employee takes 15 seconds to fetch the data!!! Which seems to be very slow. But when I say select id,name from empoyee it executes in 30ms. Same pefromance if I say select count(*) from emloyee. Why the query is slow if I included all the columns in the table. As per my understanding , number of columns should not be having a major im= pact on the query performance. I have increased the shared_buffres to 1024MB, but no improvement. I have noticed that the query "show shared_buffers" always show 8= MB.Why is this? Does it mean that changing the shared_buffers in config fil= e have no impact? Can anybody help? Shaiju

Could you run an EXPLAIN ANALYZE on the query?=A0= And what do the columns contain?=A0 For instance, if you have 10 columns e= ach returning massive XML documents, each hundreds of megs, the bottleneck = would be I/O bandwidth.

--
Thom Brown
Twitter: @darkixion
IRC (freenode):= dark_ixion
Registered Linux user: #516935
--90e6ba613af0b340af04948c4f46-- From justinpitts@gmail.com Mon Nov 8 15:37:52 2010 Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 467451337999 for ; Mon, 8 Nov 2010 11:37:52 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 54965-05 for ; Mon, 8 Nov 2010 15:37:39 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ey0-f174.google.com (mail-ey0-f174.google.com [209.85.215.174]) by mail.postgresql.org (Postfix) with ESMTP id 651F6133798E for ; Mon, 8 Nov 2010 11:37:37 -0400 (AST) Received: by eye27 with SMTP id 27so2818098eye.19 for ; Mon, 08 Nov 2010 07:37:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=BbsNW5XJ/lV2Ou546qnmz2bOeWv5C1fgauRJHpXRVtA=; b=ES0Knlgg6r1rsOBQvDskCsh3Za4yXTaK80qcdytjUcLgkcyCT5OBZIRzKDpAYjElOI fB64T6eJPLcQ8QLtUg6amYIUIS+wsPHqtVfRiZcBYUJQzwL6yWo0AJ42P/NmqSlMrb5h KRb/SOvVg0t+CopptCy0ZM858W018DHpk3eX8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=Qi94kDFR81jR/OaZAlr4tTiBS9eYNNfyH3iOjbtgV0WO5dXtAsVMWrfyGZjNRtj6y8 Ik3MlrdqZ58QN7uBem99TqNS0/Tz59Lst4YV3K9gFxF29Gx0mdqZMbEs7IhMujF7/Loy UacOTotzvMHFttwLiayuJA0iRRbKXatD1zoCI= MIME-Version: 1.0 Received: by 10.213.32.204 with SMTP id e12mr2686997ebd.43.1289230656589; Mon, 08 Nov 2010 07:37:36 -0800 (PST) Received: by 10.213.29.194 with HTTP; Mon, 8 Nov 2010 07:37:36 -0800 (PST) In-Reply-To: <1289197016462-3254568.post@n5.nabble.com> References: <1289197016462-3254568.post@n5.nabble.com> Date: Mon, 8 Nov 2010 10:37:36 -0500 Message-ID: Subject: Re: Select * is very slow From: Justin Pitts To: "shaiju.ck" Cc: pgsql-performance@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201011/110 X-Sequence-Number: 41134 On Mon, Nov 8, 2010 at 1:16 AM, shaiju.ck wrote: > [....] I have increased the shared_buffres to 1024MB, but no > improvement. I have noticed that the query "show shared_buffers" always show > 8MB.Why is this? Does it mean that changing the shared_buffers in config > file have no impact? Can anybody help? Shaiju Have you restarted PostgreSQL? Changing that setting requires a complete restart for it to take effect. From Kevin.Grittner@wicourts.gov Mon Nov 8 17:02:02 2010 Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 3ACCC1337B47 for ; Mon, 8 Nov 2010 13:02:02 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 83740-09 for ; Mon, 8 Nov 2010 17:01:54 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gw.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by mail.postgresql.org (Postfix) with ESMTP id 852561337999 for ; Mon, 8 Nov 2010 13:01:54 -0400 (AST) Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Mon, 08 Nov 2010 11:01:53 -0600 Message-Id: <4CD7D89A02000025000373D8@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Mon, 08 Nov 2010 11:01:46 -0600 From: "Kevin Grittner" To: "shaiju.ck" , Subject: Re: Select * is very slow References: <1289197016462-3254568.post@n5.nabble.com> In-Reply-To: <1289197016462-3254568.post@n5.nabble.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-4.21 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201011/103 X-Sequence-Number: 41127 "shaiju.ck" wrote: > The table have 200 records now. > Select * from employee takes 15 seconds to fetch the data!!! > Which seems to be very slow. > But when I say select id,name from empoyee it executes in 30ms. > Same pefromance if I say select count(*) from emloyee. You haven't given nearly enough information for anyone to diagnose the issues with any certainty. Earlier responses have asked for some particularly important information, and I would add a request to see the output from `VACUUM VERBOSE employee;`. Beyond that, you might want to review this page for checks you can make yourself, and information which you could provide to allow people to give more informed advice: http://wiki.postgresql.org/wiki/SlowQueryQuestions -Kevin From Kevin.Grittner@wicourts.gov Mon Nov 8 17:09:00 2010 Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id E334D1337B4E for ; Mon, 8 Nov 2010 13:09:00 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 51332-07 for ; Mon, 8 Nov 2010 17:08:53 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gw.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by mail.postgresql.org (Postfix) with ESMTP id 567551337999 for ; Mon, 8 Nov 2010 13:08:53 -0400 (AST) Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Mon, 08 Nov 2010 11:08:52 -0600 Message-Id: <4CD7DA3B02000025000373DD@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Mon, 08 Nov 2010 11:08:43 -0600 From: "Kevin Grittner" To: "shaiju.ck" , Subject: Re: Select * is very slow References: <1289197016462-3254568.post@n5.nabble.com> In-Reply-To: <1289197016462-3254568.post@n5.nabble.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-4.21 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201011/104 X-Sequence-Number: 41128 "shaiju.ck" wrote: > I have increased the shared_buffres to 1024MB, but no improvement. > I have noticed that the query "show shared_buffers" always show > 8MB.Why is this? Does it mean that changing the shared_buffers in > config file have no impact? Did you signal PostgreSQL to "reload" its configuration after making the change? Oh, and please show us the result of running `select version();` and tell us about the hardware and OS. -Kevin From spam_eater@gmx.net Mon Nov 8 17:09:40 2010 Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id DEDB71337B55 for ; Mon, 8 Nov 2010 13:09:40 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 52006-06 for ; Mon, 8 Nov 2010 17:09:33 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mail.postgresql.org (Postfix) with ESMTP id 730261337999 for ; Mon, 8 Nov 2010 13:09:33 -0400 (AST) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PFVDo-0004qo-1e for pgsql-performance@postgresql.org; Mon, 08 Nov 2010 18:09:32 +0100 Received: from 217.110.94.67 ([217.110.94.67]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 08 Nov 2010 18:09:32 +0100 Received: from spam_eater by 217.110.94.67 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 08 Nov 2010 18:09:32 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-performance@postgresql.org From: Thomas Kellerer Subject: Re: Select * is very slow Date: Mon, 08 Nov 2010 18:09:21 +0100 Lines: 30 Message-ID: References: <1289197016462-3254568.post@n5.nabble.com> <4CD7D89A02000025000373D8@gw.wicourts.gov> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 217.110.94.67 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666 In-Reply-To: <4CD7D89A02000025000373D8@gw.wicourts.gov> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.746 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_NUMERIC_HELO=1.164, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201011/105 X-Sequence-Number: 41129 Kevin Grittner, 08.11.2010 18:01: > "shaiju.ck" wrote: > >> The table have 200 records now. >> Select * from employee takes 15 seconds to fetch the data!!! >> Which seems to be very slow. >> But when I say select id,name from empoyee it executes in 30ms. >> Same pefromance if I say select count(*) from emloyee. > > You haven't given nearly enough information for anyone to diagnose > the issues with any certainty. Earlier responses have asked for > some particularly important information, and I would add a request > to see the output from `VACUUM VERBOSE employee;`. Beyond that, you > might want to review this page for checks you can make yourself, and > information which you could provide to allow people to give more > informed advice: Do you really think that VACCUM is the problem? If the OP only selects two columns it is apparently fast. If he selects all columns it's slow, so I wouldn't suspect dead tuples here. My bet is that there are some really large text columns in there... He has asked the same question here: http://forums.devshed.com/postgresql-help-21/select-is-very-slow-761130.html but has also failed to answer the question about the table details... Regards Thomas From Kevin.Grittner@wicourts.gov Mon Nov 8 17:16:12 2010 Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 16F1A1337B55 for ; Mon, 8 Nov 2010 13:16:12 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 98615-04 for ; Mon, 8 Nov 2010 17:16:05 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gw.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by mail.postgresql.org (Postfix) with ESMTP id 8E3FD1337B49 for ; Mon, 8 Nov 2010 13:16:04 -0400 (AST) Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Mon, 08 Nov 2010 11:16:03 -0600 Message-Id: <4CD7DBEC02000025000373E2@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Mon, 08 Nov 2010 11:15:56 -0600 From: "Kevin Grittner" To: "Thomas Kellerer" , Subject: Re: Select * is very slow References: <1289197016462-3254568.post@n5.nabble.com> <4CD7D89A02000025000373D8@gw.wicourts.gov> In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-4.21 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201011/106 X-Sequence-Number: 41130 Thomas Kellerer wrote: > Kevin Grittner, 08.11.2010 18:01: >> I would add a request to see the output from `VACUUM VERBOSE >> employee;`. > Do you really think that VACCUM is the problem? If the OP only > selects two columns it is apparently fast. > If he selects all columns it's slow, so I wouldn't suspect dead > tuples here. > > My bet is that there are some really large text columns in > there... That's something we can infer pretty well from the verbose output. -Kevin From lists@peufeu.com Mon Nov 8 18:42:05 2010 Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id D19A41337B49 for ; Mon, 8 Nov 2010 14:42:05 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 09253-07 for ; Mon, 8 Nov 2010 18:41:59 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from 30.mail-out.ovh.net (30.mail-out.ovh.net [213.186.62.213]) by mail.postgresql.org (Postfix) with SMTP id 210401337B98 for ; Mon, 8 Nov 2010 14:41:57 -0400 (AST) Received: (qmail 26905 invoked by uid 503); 8 Nov 2010 18:19:58 -0000 Received: from b6.ovh.net (HELO mail639.ha.ovh.net) (213.186.33.56) by 30.mail-out.ovh.net with SMTP; 8 Nov 2010 18:19:58 -0000 Received: from b0.ovh.net (HELO queueout) (213.186.33.50) by b0.ovh.net with SMTP; 8 Nov 2010 20:42:06 +0200 Received: from par69-8-88-161-102-87.fbx.proxad.net (HELO apollo13) (lists%peufeu.com@88.161.102.87) by ns0.ovh.net with SMTP; 8 Nov 2010 20:42:05 +0200 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: pgsql-performance@postgresql.org, "shaiju.ck" Subject: Re: Select * is very slow References: <1289197016462-3254568.post@n5.nabble.com> Date: Mon, 08 Nov 2010 19:41:53 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Pierre C" Message-ID: In-Reply-To: <1289197016462-3254568.post@n5.nabble.com> User-Agent: Opera Mail/10.62 (Linux) X-Ovh-Tracer-Id: 4935100767537333809 X-Ovh-Remote: 88.161.102.87 (par69-8-88-161-102-87.fbx.proxad.net) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-Spam-Check: DONE|U 0.5/N X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201011/109 X-Sequence-Number: 41133 > The table have 200 records now. > Select * from employee takes 15 seconds to fetch the data!!! > Which seems to be very slow. > But when I say select id,name from empoyee it executes in 30ms. 30 ms is also amazingly slow for so few records and so little data. - please provide results of "EXPLAIN ANALYZE SELECT id FROM table" - huge bloat (table never vacuumed ?) => VACUUM VERBOSE - bad network cable, network interface reverting to 10 Mbps, badly configured network, etc ? (test it and test ping to server, throughput, etc) - server overloaded (swapping, etc) ? (vmstat, iostat, top, etc)