Re: Performance on inserts

From: Alfred Perlstein <bright(at)wintelcom(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jules Bean <jules(at)jellybean(dot)co(dot)uk>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Performance on inserts
Date: 2000-08-25 18:35:49
Message-ID: 20000825113549.B1209@fw.wintelcom.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

* Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> [000825 11:30] wrote:
> Alfred Perlstein <bright(at)wintelcom(dot)net> writes:
> > I'm unsure if it's possible, but somehow storing the last place one
> > 'gave up' and decided to split the page could offer a useful next-start
> > for the next insert.
>
> I think that that would create problems with concurrency --- the
> Lehman-Yao btree algorithm is designed around the assumption that
> writers only move right and never want to go back left to change
> a prior page. So once we've moved right we don't get to go back to
> the start of the chain of duplicates.

Yes, but inconsistancies about the starting page should be handled
because i'm sure the code takes care of multiple scans from the
start. A slightly incorrect startscan point is better than starting
from the beginning every time. It's a hack, but no more than a random
guess where in my situation (if it's do-able) will eventually get
past the first bunch of full pages.

> > For some reason it looks like your algorithm might cause
> > problems because it plain gives up after 10 pages?
>
> "Give up" just means "stop looking for already-existing free space,
> and make some the hard way". The steady-state average space utilization
> of this way would be somewhat worse than the existing code, probably,
> but I don't see that as a big problem.

Well there's a possibility of the end of the sequence containing
free space, allowing previous failures to be accounted for can make
a difference.

But it's just a suggestion from someone who really ought to be
studying the internals a bit more. :)

--
-Alfred Perlstein - [bright(at)wintelcom(dot)net|alfred(at)freebsd(dot)org]
"I have the heart of a child; I keep it in a jar on my desk."

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Rini Dutta 2000-08-25 19:20:59 queries and inserts
Previous Message Tom Lane 2000-08-25 18:25:37 Re: Performance on inserts