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