Re: TupleDesc refcounting

From: Neil Conway <neilc(at)samurai(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: TupleDesc refcounting
Date: 2006-01-17 07:00:12
Message-ID: 1137481212.9145.102.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

On Sun, 2006-01-15 at 12:08 -0500, Tom Lane wrote:
> My inclination at this point is to forget the whole thing and just patch
> the callers of lookup_rowtype_tupdesc that need to copy the tupdesc.

Actually, I think I finally understand how to implement this patch
sanely. I had thought that the lifetime of a TupleDesc should be
dictated by either the memory context in which it is allocated, OR its
reference count. This leads us down the road toward mandatory reference
counting, which I agree is a net loss. However, since we're primarily
concerned with TupleDescs allocated in CacheMemoryContext and that
context is never reset, we can use the reference count *just* to manage
the "external" references to TupleDescs. That should make the patch far
less invasive. (I have the feeling you've been suggesting this all
along, I've just been too thick-skulled to understand you.)

I'll hopefully have a patch implementing this finished by tomorrow
evening.

-Neil

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2006-01-17 14:36:13 Re: TupleDesc refcounting
Previous Message Neil Conway 2006-01-17 06:28:10 Re: patch to create system view that lists cursors