Re: Columns correlation and adaptive query optimization

From: Konstantin Knizhnik <k(dot)knizhnik(at)postgrespro(dot)ru>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Columns correlation and adaptive query optimization
Date: 2019-10-18 16:53:23
Message-ID: f4d38220-db92-ea17-2a92-5f3aed93247e@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Smarter version of join selectivity patch handling cases like this:

explain select * from outer_tab join inner_tab using(x,y) where x=1;
                                           QUERY PLAN
------------------------------------------------------------------------------------------------
 Nested Loop  (cost=0.42..1815.47 rows=10 width=12)
   Join Filter: (outer_tab.y = inner_tab.y)
   ->  Seq Scan on outer_tab  (cost=0.00..1791.00 rows=1 width=12)
         Filter: (x = 1)
   ->  Index Only Scan using inner_tab_x_y_idx on inner_tab
(cost=0.42..24.35 rows=10 width=8)
         Index Cond: (x = 1)
(6 rows)

--
Konstantin Knizhnik
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

Attachment Content-Type Size
auto_explain_create_statistics.patch text/x-patch 9.8 KB
join_selectivity-2.patch text/x-patch 17.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ariadne Conill 2019-10-18 17:37:24 jsonb_set() strictness considered harmful to data
Previous Message Justin Pryzby 2019-10-18 16:15:02 Re: Can you please tell us how set this prefetch attribute in following lines.