Re: Todo item: Support amgettuple() in GIN - Mailing list pgsql-hackers

From Antonin Houska
Subject Re: Todo item: Support amgettuple() in GIN
Date
Msg-id 52985644.8070108@gmail.com
Whole thread Raw
In response to Todo item: Support amgettuple() in GIN  (Andreas Karlsson <andreas@proxel.se>)
Responses Re: Todo item: Support amgettuple() in GIN  (Andreas Karlsson <andreas@proxel.se>)
List pgsql-hackers
On 11/29/2013 01:13 AM, Andreas Karlsson wrote:

> When doing partial matching the code need to be able to return the union 
> of all TIDs in all the matching posting trees in TID order (to be able 
> to do AND and OR operations with multiple search keys later). It does 
> this by traversing them posting tree after posting tree and collecting 
> them all in a TIDBitmap which is later iterated over.

I think it's not a plain union. My understanding is that - to evaluate a
single key (typically array) - you first need to get all the TID streams
for that key (i.e. one posting list/tree per element of the key array)
and then iterate all these streams in parallel and 'merge' them     using
consistent() function. That's how I understand ginget.c:keyGetItem().

So the problem of partial match is (IMO) that there can be too many TID
streams to merge - much more than the number of elements of the key array.

// Antonin Houska (Tony)




pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: MultiXact truncation, startup et al.
Next
From: Magnus Hagander
Date:
Subject: Re: docbook-xsl version for release builds