Re: Hash-based MCV matching for large IN-lists - Mailing list pgsql-hackers

From Zsolt Parragi
Subject Re: Hash-based MCV matching for large IN-lists
Date
Msg-id CAN4CZFOJ2nwOvLzkg_5n0NPfn37_as_O6th7OXey1it0UUhWKA@mail.gmail.com
Whole thread Raw
In response to Re: Hash-based MCV matching for large IN-lists  (Ilia Evdokimov <ilya.evdokimov@tantorlabs.com>)
Responses Re: Hash-based MCV matching for large IN-lists
List pgsql-hackers
+ if (elem_nulls[i])
+ {
+ nonmcv_cnt--;
+ continue;
+ }

> The patch v8 can still be reviewed as-is, and if the selectivity
> regression test gets committed [0], I will add corresponding tests for
> this change as well.

Without [0], the const path will return incorrect results for <> ALL
and NULLs. Compared to that, the other path still has special handling
in it:

+ /*
+ * For ALL semantics, if the array contains NULL, assume
+ * operator is strict. The ScalarArrayOpExpr cannot
+ * evaluate to TRUE, so return zero.
+ */



+ nonconst_sel = var_eq_non_const(&vardata, operator,
+ clause->inputcollid,
+ other_op, var_on_left,
+ isInequality);

+ if (isInequality)
+ individual_s = 1.0 - individual_s - nullfrac;

Isn't this the double negation issue again, which was once
mentioned/fixed earlier?

+ int count; /* number of occurrences of current value in */

That's a truncated comment



pgsql-hackers by date:

Previous
From: "Hayato Kuroda (Fujitsu)"
Date:
Subject: RE: Patch for migration of the pg_commit_ts directory
Next
From: shveta malik
Date:
Subject: Re: synchronized_standby_slots behavior inconsistent with quorum-based synchronous replication