Re: Question about double table scans for a table

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Ba Jinsheng <bajinsheng(at)u(dot)nus(dot)edu>
Cc: "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>, Manuel Rigger <rigger(at)nus(dot)edu(dot)sg>
Subject: Re: Question about double table scans for a table
Date: 2023-07-28 13:26:30
Message-ID: CAMkU=1yL+g0VHM_OEgkhMiq6AbOOMN3zVXYK6pfs2HgQEsFb0g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

> or does this indicate an optimization that is not performed by PostgreSQL?

Yes, this is an optimization which PostgreSQL doesn't do.

PostgreSQL does not claim to implement every conceivable optimization, so
this is not a bug. You are in the wrong forum. If you had working code to
implement this, or a serious plan to write some, then pgsql-hackers would
be the right place to go. But if you are just pointing out a curiosity, I
doubt you would get much traction there. (I could be wrong, maybe there is
some easy way to hook this into the same code used by GROUPING SETS which
someone would be willing to do just based on your example, but I don't
think so asGROUPING SETS produces extra rows, while I think this would need
extra columns)

Cheers,

Jeff

>

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Nathan Bossart 2023-07-28 18:00:56 Re: Fwd: BUG #18016: REINDEX TABLE failure
Previous Message Laurenz Albe 2023-07-28 06:22:51 Re: BUG #18038: Aliases removed from view definitions