Re: ltree + gist index performance degrades significantly over a night

From: CG <cgg007(at)yahoo(dot)com>
To: Bernhard Weisshuhn <bkw(at)weisshuhn(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: ltree + gist index performance degrades significantly over a night
Date: 2006-02-28 23:00:32
Message-ID: 20060228230032.85535.qmail@web32506.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

--- Bernhard Weisshuhn <bkw(at)weisshuhn(dot)de> wrote:

> On Mon, Feb 27, 2006 at 10:27:20AM -0800, CG <cgg007(at)yahoo(dot)com> wrote:
>
> > [...] I'd need to see if the space required for the varchar+btree tables
> are
> > comparible, better, or worse than the ltree+gist tables with regards to
> size.
>
> Please test this, I'm guessing (hoping actually) that having bazillions of
> combinations of 26 (or so) characters (ltree labels) might be consuming
> less space than having bazillions of substings in the database.
>
> Or maybe some clever combination of both approaches?
>
> If you find out something interesting, please let me know.

Performance using varchar+btree, breaking up the string into distinct letter
groups >= 3 chars is slightly better. Size of the varchar search vector table
table is much bigger.. Most of my fields are about 15-25 characters in length.
Expect even bigger tables for longer fields. The size of the btree index is
less. The time to bootstrap the data into the tables was significantly longer.
I used two triggers, one that normalized the search field before insert, and
another that inserted a breakdown row after the insert row. There's a recursive
effect built-in to get down to the smallest unique element.

I'm sticking with ltree and setting up a vacuum analyze on a cron to keep the
searches snappy. Hope that helps you with your project!

CG

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jim C. Nasby 2006-02-28 23:56:45 Re: majordomo unmaintained, postmaster emails ignored?
Previous Message Karen Ploski 2006-02-28 22:14:13 Questions about large objects and the WAL