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

Speeding up tupledesc copying

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: Speeding up tupledesc copying
Date: 2005-03-06 19:14:47
Message-ID: 6045.1110136487@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
I was just doing some profiling of plpgsql record operations, and
noticed that an unreasonable amount of runtime was being consumed
by palloc/pfree calls coming from CreateTupleDescCopy.  The reason
for this of course is that each attribute's storage is separately
palloc'd.  This seems a little silly given that the tupdesc
management code doesn't have any provision for changing the number
of attributes in an existing tupdesc.  We could just as well
allocate all the space needed in one palloc call, with a little bit
of added address-arithmetic to set up the pointers.  This would
require some localized changes in tupdesc.c and relcache.c,
but most users of tupdescs would never know the difference.
Can anyone see a reason not to make this change?

			regards, tom lane

pgsql-hackers by date

Next:From: Pavel StehuleDate: 2005-03-06 19:24:38
Subject: Implementation of SQLCODE and SQLERRM variables for PL/pgSQL
Previous:From: Magnus HaganderDate: 2005-03-06 18:44:03
Subject: Re: refactoring fork() and EXEC_BACKEND

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