Why not do distinct before SetOp

From: ma lz <ma100(at)hotmail(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Why not do distinct before SetOp
Date: 2024-11-04 09:52:12
Message-ID: TYCPR01MB63514B9C70EF2A80F0D43394F2512@TYCPR01MB6351.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Rowley 2024-11-04 11:09:35 Re: Why not do distinct before SetOp
Previous Message Vijaykumar Jain 2024-11-03 21:27:49 Re: Random memory related errors on live postgres 14.13 instance on Ubuntu 22.04 LTS