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

From Ilia Evdokimov
Subject Re: Hash-based MCV matching for large IN-lists
Date
Msg-id 03aa576f-13bb-4ed1-bee4-0ee69ad8813c@tantorlabs.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
I've addressed the previously mentioned issues in v7 patches.

I also retested the hash-based MCV path using bytea as the data type.

```
CREATE TABLE t (val bytea);
INSERT INTO t SELECT int4send(i) FROM generate_series(1, 10000) AS i, 
generate_series(1, 50);

ALTER TABLE t ALTER COLUMN val SET STATISTICS 10000;
ANALYZE t;
SELECT string_agg(format('int4send(%s)', v), ',') FROM 
generate_series(1, 10000) AS gs(v) \gset
EXPLAIN (SUMMARY) SELECT * FROM t WHERE val = 
ANY(ARRAY[:string_agg]::bytea[]);
```

Planning Time Speedup

default_statistics_target | Before (ms) | After (ms) | Speedup (x)
--------------------------------------------------------------------
100                       | 0.984       | 0.697      | 1.41
500                       | 1.260       | 0.984      | 1.28
1000                      | 4.183       | 1.825      | 2.29
2500                      | 64.715      | 1.298      | 49.86
5000                      | 251.619     | 4.751      | 52.96
7500                      | 562.775     | 2.895      | 194.40
10000                     | 998.330     | 3.561      | 280.36

-- 
Best regards,
Ilia Evdokimov,
Tantor Labs LLC,
https://tantorlabs.com/

Attachment

pgsql-hackers by date:

Previous
From: Chao Li
Date:
Subject: Question: rebuilding frontend tools after libpgfeutils.a changes?
Next
From: Jakub Wartak
Date:
Subject: Re: pg_buffercache: Add per-relation summary stats