X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id EDE5B9DC86C for ; Mon, 16 Jan 2006 17:54:01 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 49272-01 for ; Mon, 16 Jan 2006 17:54:00 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from floppy.pyrenet.fr (news.pyrenet.fr [194.116.145.2]) by postgresql.org (Postfix) with ESMTP id 78CC09DC878 for ; Mon, 16 Jan 2006 17:53:56 -0400 (AST) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id 469D63093D; Mon, 16 Jan 2006 22:53:57 +0100 (MET) From: "Qingqing Zhou" X-Newsgroups: pgsql.performance Subject: Re: Use of * affect the performance Date: Mon, 16 Jan 2006 16:55:11 -0500 Organization: Hub.Org Networking Services Lines: 25 Message-ID: References: <1137422968.1085.25.camel@servidor> X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.164 required=5 tests=[AWL=0.164] X-Spam-Score: 0.164 X-Spam-Level: X-Archive-Number: 200601/208 X-Sequence-Number: 16686 "Marcos" wrote > > I always think that use of * in SELECT affected in the performance, > becoming the search slowest. > > But I read in the a Postgres book's that it increases the speed of > search. > > And now???? What the more fast? > If you mean use "*" vs. "explicitely name all columns of a relation", then there is almost no difference except the negligible difference in parsing. If you mean you just want part of the columns of a relation but you still use "*": Yes, you will save one projection operation for each result row but you will pay for more network traffic. In the worst case, say your "*" involves some toast attributes, you just hurt performance. Considering the benefits is so marginal and dangerous, I suggest stay with the idea that "only retrive the columns that you are interested in". Regards, Qingqing