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 CAN4CZFPb+iqQkby4AGvZSvL2OkwQ+S9CVvmJiQ=u6cckWPetqA@mail.gmail.com
Whole thread
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
Hello

+ hashContext.hash_fcinfo = hash_fcinfo;
+ hashContext.op_is_reversed = !hash_mcv;
+ hashContext.insert_mode = true;

Are you sure about op_is_reversed, isn't it backwards, shouldn't it be
= hash_mcv instead?

See the following testcase:

CREATE TABLE test_cross_type_bug (val float4);

INSERT INTO test_cross_type_bug
    SELECT v
      FROM generate_series(1, 200) AS v,
           generate_series(1, 50);

ALTER TABLE test_cross_type_bug ALTER COLUMN val SET STATISTICS 200;
ANALYZE test_cross_type_bug;

SELECT string_agg(v::text, ', ') AS in_list
  FROM generate_series(1, 200) AS gs(v) \gset

EXPLAIN SELECT * FROM test_cross_type_bug
 WHERE val = ANY(ARRAY[:in_list]::float4[]);

EXPLAIN SELECT * FROM test_cross_type_bug
 WHERE val = ANY(ARRAY[:in_list]::float8[]);

DROP TABLE test_cross_type_bug;



pgsql-hackers by date:

Previous
From: "Matheus Alcantara"
Date:
Subject: Re: Initial COPY of Logical Replication is too slow
Next
From: Sami Imseih
Date:
Subject: Re: Fix bug in multixact Oldest*MXactId initialization and access