Re: strange error occurs when adding index

From: Dimitri Fontaine <dfontaine(at)hi-media(dot)com>
To: depesz(at)depesz(dot)com
Cc: Juan Backson <juanbackson(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: strange error occurs when adding index
Date: 2009-09-04 19:34:31
Message-ID: m2bplq1p2w.fsf@hi-media.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

hubert depesz lubaczewski <depesz(at)depesz(dot)com> writes:

> On Fri, Sep 04, 2009 at 05:42:31PM +0800, Juan Backson wrote:
>> When I tried to add the following index, I get some strange error. Does
>> anyone know what these errors mean and how to fix it?
>> Here is the index query:
>> create index idx_product_items_digits on product_items using gist (digits
>> gist_prefix_range_ops,product_id)
>
> these are not errors, just notices. are you sure you have the latest
> prefix version?

I just realized earlier this week that the pgfoundry main page for
prefix was proposing the very old (as in avoid it) 0.2 version. It's now
fixed to list the current 1.0~rc2 version, which you'll find also in
debian testing and sid:
http://pgfoundry.org/projects/prefix/
http://packages.debian.org/search?searchon=sourcenames&keywords=prefix

This version still comes with #define DEBUG (hey, it's a release
candidate) and penalty() is chatty on some cases where it finds that
your prefix ranges are not containing only numbers, because the penalty
computation isn't really verified against the general case... but should
work: you just won a non-numeric-only prefix_range testing ticket :)

Have you got anything to report performance wise?

Given:
>>  __pr_penalty(sa[], a1928901[]) orig->first=0 orig->last=0
>> NOTICE:  __pr_penalty(sa[], 1206323[]) orig->first=0 orig->last=0

Could you report the result of:
SELECT pr_penalty('sa', 'a1928901'), pr_penalty('sa', '1206323');

If you're happy with performances as is, I'll remove the NOTICE and
Assert(), if not, we'll have to either find a more general algorithm or
limit the accepted inputs.

Regards,
--
dim

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Martin Gainty 2009-09-04 19:37:34 Re: where clause question
Previous Message William Temperley 2009-09-04 18:08:58 Re: [Q] optmizing postgres for 'single client' / many small queries