Skip site navigation (1) Skip section navigation (2)

Re: Terrible performance on wide selects

From: "Dann Corbit" <DCorbit(at)connx(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Steve Crawford" <scrawford(at)pinpointresearch(dot)com>,<pgsql-performance(at)postgreSQL(dot)org>, <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: Terrible performance on wide selects
Date: 2003-01-23 00:06:26
Message-ID: D90A5A6C612A39408103E6ECDD77B8294CD862@voyager.corporate.connx.com (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-performance
> -----Original Message-----
> From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us] 
> Sent: Wednesday, January 22, 2003 4:04 PM
> To: Dann Corbit
> Cc: Steve Crawford; pgsql-performance(at)postgreSQL(dot)org; 
> pgsql-hackers(at)postgreSQL(dot)org
> Subject: Re: [HACKERS] Terrible performance on wide selects 
> 
> 
> "Dann Corbit" <DCorbit(at)connx(dot)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.

Responses

pgsql-performance by date

Next:From: Josh BerkusDate: 2003-01-23 00:17:41
Subject: Re: [PERFORM] Proposal: relaxing link between explicit JOINs and execution order
Previous:From: Tom LaneDate: 2003-01-23 00:06:12
Subject: Re: [PERFORM] Proposal: relaxing link between explicit JOINs and execution order

pgsql-hackers by date

Next:From: Josh BerkusDate: 2003-01-23 00:17:41
Subject: Re: [PERFORM] Proposal: relaxing link between explicit JOINs and execution order
Previous:From: Tom LaneDate: 2003-01-23 00:06:12
Subject: Re: [PERFORM] Proposal: relaxing link between explicit JOINs and execution order

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group