Re: Terrible performance on wide selects - Mailing list pgsql-hackers

From Dann Corbit
Subject Re: Terrible performance on wide selects
Date
Msg-id D90A5A6C612A39408103E6ECDD77B8294CD862@voyager.corporate.connx.com
Whole thread Raw
Responses Re: Terrible performance on wide selects  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> -----Original Message-----
> From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
> Sent: Wednesday, January 22, 2003 4:04 PM
> To: Dann Corbit
> Cc: Steve Crawford; pgsql-performance@postgreSQL.org;
> pgsql-hackers@postgreSQL.org
> Subject: Re: [HACKERS] Terrible performance on wide selects
>
>
> "Dann Corbit" <DCorbit@connx.com> writes:
> > Maybe I don't really understand the problem, but it seems simple
> > enough to do it once for the whole query.
>
> We already do cache column offsets when they are fixed.  The
> code that's the problem executes when there's a
> variable-width column in the table
> --- which means that all columns to its right are not at
> fixed offsets, and have to be scanned for separately in each
> tuple, AFAICS.

Why not waste a bit of memory and make the row buffer the maximum
possible length?
E.g. for varchar(2000) allocate 2000 characters + size element and point
to the start of that thing.

If we have 64K rows, even at that it is a pittance.  If someone designs
10,000 row tables, then it will allocate an annoyingly large block of
memory, but bad designs are always going to cause a fuss.

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [PERFORM] Proposal: relaxing link between explicit JOINs and execution order
Next
From: Josh Berkus
Date:
Subject: Re: [PERFORM] Proposal: relaxing link between explicit JOINs and execution order