Re: brininsert optimization opportunity

From: James Wang <jwang25610(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: brininsert optimization opportunity
Date: 2023-12-21 10:05:11
Message-ID: 170315311175.2631681.12214566971840476644.pgcf@coridan.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi All, not sure how to "Specify thread msgid" - choose one which i think is close to my new feature request.

query:

SELECT count(1) FROM table1 t1 JOIN table2 t2 ON t1.id = t2.id WHERE t1.a_indexed_col='some_value' OR t2.a_indexed_col='some_vable';

can the server automatically replace the OR logic above with UNION please? i.e. replace it with:

(SELECT count(1) FROM table1 t1 JOIN table2 t2 ON t1.id = t2.id WHERE t1.a_indexed_col='some_value' )
UNION
(SELECT count(1) FROM table1 t1 JOIN table2 t2 ON t1.id = t2.id WHERE t2.a_indexed_col='some_vable');

Thanks

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2023-12-21 10:10:46 Re: Postgres picks suboptimal index after building of an extended statistics
Previous Message Andres Freund 2023-12-21 09:40:15 Re: Track in pg_replication_slots the reason why slots conflict?