Re: Get more from indices. - Mailing list pgsql-hackers

From Etsuro Fujita
Subject Re: Get more from indices.
Date
Msg-id 5346672F.1060202@lab.ntt.co.jp
Whole thread Raw
In response to Re: Get more from indices.  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Get more from indices.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
(2014/04/10 0:08), Tom Lane wrote:
> Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp> writes:
>> Oops! I found a bug in this patch. The previous v8 patch missed
>> the case that build_index_pathkeys() could build a partial
>> pathkeys from the index tlist.
> 
> TBH I think that's barely the tip of the iceberg of cases where this
> patch will get the wrong answer.

> Also, I don't see it doing anything to check the ordering
> of multiple index columns

I think that the following code in index_pathkeys_are_extensible() would
check the ordering:

+    if (!pathkeys_contained_in(pathkeys, root->query_pathkeys))
+        return false;

> Also, what's with the success return
> before the loop:
> 
> +    if (list_length(pathkeys) == list_length(root->query_pathkeys))
> +        return true;
> 
> At this point you haven't proven *anything at all* about whether the
> index columns have something to do with the query_pathkeys.

I think that the two pathkeys would be proved to be equal, if the both
conditions are satisfied.

Thanks,

Best regards,
Etsuro Fujita



pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: WAL replay bugs
Next
From: Rajeev rastogi
Date:
Subject: