Re: [HACKERS] Volunteer: Large Tuples / Tuple chaining

From: wieck(at)debis(dot)com (Jan Wieck)
To: tgl(at)sss(dot)pgh(dot)pa(dot)us (Tom Lane)
Cc: wieck(at)debis(dot)com, pgman(at)candle(dot)pha(dot)pa(dot)us, Inoue(at)tpf(dot)co(dot)jp, christof(dot)petig(at)wtal(dot)de, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Volunteer: Large Tuples / Tuple chaining
Date: 1999-12-14 21:32:52
Message-ID: m11xzYy-0003kGC@orion.SAPserv.Hamburg.dsh.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:

> wieck(at)debis(dot)com (Jan Wieck) writes:
> > I think that only a combination of LONG attributes and split
> > tuples will be a complete solution.
>
> If we can do a good job with long attributes, I really think we
> will not need to have split tuples too.

I really hope so, because there will be very severe problems
coming up with a real tuple split at arbitrary cut points
that can occur somewhere in the middle of an attribute.
Arbitrary cut points are the only way to support single
values over BLKSIZE.

Just to tell one problem, the scan key tests during
heap_getnext() are handed down into heapgettup() and
performed with HeapTupleSatisfies, a macro using the in
buffer tuple here. IIRC it was turned into a macro in one of
our last releases for performance reasons.

If now faced with a tuple living in multiple pages, these
checks will need to reconstruct the tuple in memory, to
concatenate the attributes well again.

This now needs to lock multiple buffers at once during
heapgettup(), where I'm not sure if they must all stay with
the bumped refcount when returning the tuple or not. So
ReleaseBuffer() might need to be changed into something,
where the HeapTuple remembers all the buffers that where
locked for it.

Also this separate ReleaseBuffer() reminds me, that there are
some places in the backend that assume a tuple returned by
heap AM allways is in a buffer! But that can't be true any
more, because a buffer allways has BLKSIZE.

> I think the effort this would take would be *much* more profitably
> spent on tuning the LONG-attribute support. If we can make that
> fast and robust, we will have very few complaints.

*MUCH*!

Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#========================================= wieck(at)debis(dot)com (Jan Wieck) #

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 1999-12-14 21:39:36 Re: Backend core dump, Please help, Urgent!
Previous Message The Hermit Hacker 1999-12-14 20:52:50 Re: [HACKERS] [6.5.3] FATAL 1: my bits moved right off the end of the world!