Re: Designing an extension for feature-space similarity search

From: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
To: Jay Levitt <jay(dot)levitt(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Designing an extension for feature-space similarity search
Date: 2012-02-17 19:40:15
Message-ID: CAPpHfdsH7j15s-RR5NfaciJQgh55NkfShSvFxTi4PHA9JZuoqg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Feb 17, 2012 at 11:32 PM, Jay Levitt <jay(dot)levitt(at)gmail(dot)com> wrote:

> Alexander Korotkov wrote:
>
>> On Fri, Feb 17, 2012 at 11:00 PM, Jay Levitt <jay(dot)levitt(at)gmail(dot)com
>> <mailto:jay(dot)levitt(at)gmail(dot)com>> wrote:
>>
>> At first I thought this posed a challenge for union; if I have these
> points:
>
>>
>> (1,2)
>> (2,1)
>> (1,NULL)
>>
>> what's the union? I think the answer is to treat NULL box coordinates
>> like LL = -infinity, UR = infinity, or (equivalently, I think) to store
>> a saw_nulls bit in addition to LL and UR.
>>
>> Similar problem appears at GiST indexing of ranges, because range can be
>> empty. There additional "contain empty" flag was introduced. This "contain
>> empty" flag indicates that underlying value can be empty. So, this flag is
>> set when union with empty range or other range with this flag set. It's
>> likely you need similar flag for each dimension.
>>
>
> Ah, yes, exactly the same problem. So what led you to add a flag instead
> of using the range NULL..NULL? I'm on the fence about choosing.

At first, range bounds can't be NULL :) At second, if we have range
(a;b)+"contain empty" in internal page, both facts:
1) All normal underlying ranges are contained in (a;b).
2) There can be empty underlying ranges.
are useful for search.

------
With best regards,
Alexander Korotkov.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2012-02-17 19:44:03 Re: MySQL search query is not executing in Postgres DB
Previous Message Don Baccus 2012-02-17 19:39:17 Re: MySQL search query is not executing in Postgres DB