From: Bruce Momjian <pgman@candle.pha.pa.us>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: 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: [HACKERS] Terrible performance on wide selects
Date: Fri, 14 Feb 2003 08:11:37 -0500 (EST)
Message-ID: <200302141311.h1EDBb020716@candle.pha.pa.us> (raw)
In-Reply-To: <25661.1043332885@sss.pgh.pa.us>
Added to TODO:
* Cache last known per-tuple offsets to speed long tuple access
---------------------------------------------------------------------------
Tom Lane wrote:
> 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
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
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: pgman@candle.pha.pa.us, tgl@sss.pgh.pa.us, hannu@tm.ee, DCorbit@connx.com, scrawford@pinpointresearch.com, pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Terrible performance on wide selects
In-Reply-To: <200302141311.h1EDBb020716@candle.pha.pa.us>
References: <25661.1043332885@sss.pgh.pa.us> <200302141311.h1EDBb020716@candle.pha.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