Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id A5F8C4773E2 for ; Fri, 17 Jan 2003 18:18:05 -0500 (EST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 92DB2476A5B for ; Fri, 17 Jan 2003 18:12:24 -0500 (EST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h0HN6q5u019507; Fri, 17 Jan 2003 18:06:54 -0500 (EST) To: Steve Crawford Cc: pgsql-general@postgresql.org Subject: Re: Terrible performance on wide selects In-reply-to: <20030117193726.1CFCB103E5@polaris.pinpointresearch.com> References: <20030117193726.1CFCB103E5@polaris.pinpointresearch.com> Comments: In-reply-to Steve Crawford message dated "Fri, 17 Jan 2003 11:37:26 -0800" Date: Fri, 17 Jan 2003 18:06:52 -0500 Message-ID: <19506.1042844812@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/671 X-Sequence-Number: 35792 Steve Crawford writes: > So the question is, does it seem reasonable that a query on fundamentally > identical data should take 70-90 times as long when displayed as individual > columns vs. when output as a raw array and, more imporantly, what can I do to > get acceptable performance on this query? There are undoubtedly some places that are O(N^2) in the number of targetlist items. Feel free to do some profiling to identify them. It probably won't be real hard to fix 'em once identified. regards, tom lane