public inbox for [email protected]  
help / color / mirror / Atom feed
From: ma lz <[email protected]>
To: [email protected] <[email protected]>
Subject: Why not do distinct before SetOp
Date: Mon, 4 Nov 2024 09:52:12 +0000
Message-ID: <TYCPR01MB63514B9C70EF2A80F0D43394F2512@TYCPR01MB6351.jpnprd01.prod.outlook.com> (raw)

some sql like ' select a from t1 intersect select a from t1 '

if t1 has large number rows but has few distinct rows

select distinct a from t1 intersect select distinct a from t1;    — this is faster than origin sql

can postgres do this optimize during plan-queries?


view thread (2+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: Why not do distinct before SetOp
  In-Reply-To: <TYCPR01MB63514B9C70EF2A80F0D43394F2512@TYCPR01MB6351.jpnprd01.prod.outlook.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox