Re: GiST index performance

From: Matthew Wakeling <matthew(at)flymine(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, pgsql-performance(at)postgresql(dot)org
Subject: Re: GiST index performance
Date: 2009-04-20 14:11:08
Message-ID: alpine.DEB.2.00.0904201503570.22330@aragorn.flymine.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Fri, 17 Apr 2009, Matthew Wakeling wrote:
> I have done a bit of investigation, and I think I might have found the
> smoking gun I was looking for.

I have found a bug in the contrib package seg, which has been copied into
the bioseg data type as well. It causes the index to be created with
horribly bad unselective trees, so that when a search is performed many of
the branches of the tree need to be followed. This explanation does not
extend to btree_gist, so I will have to further investigate that. Apply
the following patch to contrib/seg/seg.c:

*** seg.c 2006-09-10 18:36:51.000000000 +0100
--- seg.c_new 2009-04-20 15:02:52.000000000 +0100
***************
*** 426,432 ****
else
{
datum_r = union_dr;
! size_r = size_alpha;
*right++ = i;
v->spl_nright++;
}
--- 426,432 ----
else
{
datum_r = union_dr;
! size_r = size_beta;
*right++ = i;
v->spl_nright++;
}

Matthew

--
The early bird gets the worm. If you want something else for breakfast, get
up later.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Grzegorz Jaśkiewicz 2009-04-20 14:14:15 Re: SQL With Dates
Previous Message Rafael Domiciano 2009-04-20 13:55:36 SQL With Dates