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: Terrible performance on wide selects
Date: Thu, 23 Jan 2003 09:41:25 -0500
Message-ID: <25661.1043332885@sss.pgh.pa.us> (raw)
In-Reply-To: <1043318508.2347.39.camel@localhost.localdomain>
References: <D90A5A6C612A39408103E6ECDD77B8294CD862@voyager.corporate.connx.com>
	<25622.1043281087@sss.pgh.pa.us>
	<1043316668.2348.15.camel@localhost.localdomain>
	<1043318508.2347.39.camel@localhost.localdomain>

Hannu Krosing <hannu@tm.ee> writes:
>> i.e. for tuple with 100 cols, allocate an array of 100 pointers, plus
>> keep count of how many are actually valid,

> Additionally, this should also make repeted determining of NULL fields
> faster - just put a NULL-pointer in and voila - no more bit-shifting and
> AND-ing to find out if the field is null.

Right, the output of the operation would be a pair of arrays: Datum
values and is-null flags.  (NULL pointers don't work for pass-by-value
datatypes.)

I like the idea of keeping track of a last-known-column position and
incrementally extending that as needed.

I think the way to manage this is to add the overhead data (the output
arrays and last-column state) to TupleTableSlots.  Then we'd have
a routine similar to heap_getattr except that it takes a TupleTableSlot
and makes use of the extra state data.  The infrastructure to manage
the state data is already in place: for example, ExecStoreTuple would
reset the last-known-column to 0, ExecSetSlotDescriptor would be
responsible for allocating the output arrays using the natts value from
the provided tupdesc, etc.

This wouldn't help for accesses that are not in the context of a slot,
but certainly all the ones from ExecEvalVar are.  The executor always
works with tuples stored in slots, so I think we could fix all the
high-traffic cases this way.

			regards, tom lane



view thread (22+ messages)  latest in thread

Message-ID: <25661.1043332885@sss.pgh.pa.us>
Permalink:  ../25661.1043332885@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/25661.1043332885@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: Terrible performance on wide selects
  In-Reply-To: <25661.1043332885@sss.pgh.pa.us>
  References: <D90A5A6C612A39408103E6ECDD77B8294CD862@voyager.corporate.connx.com> <25622.1043281087@sss.pgh.pa.us> <1043316668.2348.15.camel@localhost.localdomain> <1043318508.2347.39.camel@localhost.localdomain> <25661.1043332885@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