pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Hannu Krosing <hannu@tm.ee>
Cc: Dann Corbit <DCorbit@connx.com>
Cc: Steve Crawford <scrawford@pinpointresearch.com>
Cc: pgsql-performance@postgreSQL.org
Cc: pgsql-hackers@postgreSQL.org
Subject: Re: [PERFORM] Terrible performance on wide selects
Date: Thu, 23 Jan 2003 09:46:50 -0500
Message-ID: <25701.1043333210@sss.pgh.pa.us> (raw)
In-Reply-To: <1043317701.2348.32.camel@localhost.localdomain>
References: <D90A5A6C612A39408103E6ECDD77B8294CD866@voyager.corporate.connx.com>
	<1043317701.2348.32.camel@localhost.localdomain>

Hannu Krosing <hannu@tm.ee> 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



view thread (22+ messages)  latest in thread

Message-ID: <25701.1043333210@sss.pgh.pa.us>
Permalink:  ../25701.1043333210@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/25701.1043333210@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, hannu@tm.ee, DCorbit@connx.com, scrawford@pinpointresearch.com, pgsql-hackers@postgreSQL.org
  Subject: Re: [PERFORM] Terrible performance on wide selects
  In-Reply-To: <25701.1043333210@sss.pgh.pa.us>
  References: <D90A5A6C612A39408103E6ECDD77B8294CD866@voyager.corporate.connx.com> <1043317701.2348.32.camel@localhost.localdomain> <25701.1043333210@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox