Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 178A1476910 for ; Thu, 23 Jan 2003 09:47:41 -0500 (EST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id DE3FF476A55 for ; Thu, 23 Jan 2003 09:46:52 -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 h0NEko5u025702; Thu, 23 Jan 2003 09:46:51 -0500 (EST) To: Hannu Krosing Cc: Dann Corbit , Steve Crawford , pgsql-performance@postgreSQL.org, pgsql-hackers@postgreSQL.org Subject: Re: [PERFORM] Terrible performance on wide selects In-reply-to: <1043317701.2348.32.camel@localhost.localdomain> References: <1043317701.2348.32.camel@localhost.localdomain> Comments: In-reply-to Hannu Krosing message dated "23 Jan 2003 12:28:21 +0200" Date: Thu, 23 Jan 2003 09:46:50 -0500 Message-ID: <25701.1043333210@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/882 X-Sequence-Number: 34492 Hannu Krosing writes: > as tuple (int,int,int,varchar,varchar) > which is currently stored as > (intdata1, intdata2, intdata3, (len4, vardata4), (len5,vardata5)) > should be rewritten on storage to > (ptr4,ptr5),(intdata1, intdata2, intdata3, vardata4,vardata5) I do not see that this buys anything at all. heap_getattr still has to make essentially the same calculation as before to determine column locations, namely adding up column widths. All you've done is move the data that it has to fetch to make the calculation. If anything, this will be slower not faster, because now heap_getattr has to keep track of two positions not one --- not just the next column offset, but also the index of the next "ptr" to use. In the existing method it only needs the column offset, because that's exactly where it can pick up the next length from. But the really serious objection is that the datatype functions that access the data would now also need to be passed two pointers, since after all they would like to know the length too. That breaks APIs far and wide :-( regards, tom lane