From: | PG Bug reporting form <noreply(at)postgresql(dot)org> |
---|---|
To: | pgsql-bugs(at)lists(dot)postgresql(dot)org |
Cc: | blamario(at)protonmail(dot)com |
Subject: | BUG #18525: Boolean aggregate functions like EVERY/BOOL_AND should shortcut |
Date: | 2024-06-28 07:14:21 |
Message-ID: | 18525-b36c2e34bde50082@postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
The following bug has been logged on the website:
Bug reference: 18525
Logged by: Mario
Email address: blamario(at)protonmail(dot)com
PostgreSQL version: 13.10
Operating system: Linux
Description:
This is a feature request, not a bug strictly speaking. I'm working with a
query of the form
```
SELECT
EVERY (field1 IS NULL) AS field1,
EVERY (field2 IS NULL) AS field2,
...
EVERY (field255 IS NULL) AS field255
FROM large_table
```
The goal is to establish if there are any columns that are always NULL, and
if so which ones. I was hoping that the EVERY aggregate functions would
_shortcut_ the aggregate as soon as a non-null value was encountered, and
furthermore that the SELECT statement would stop searching once all results
are established to be false. That's not happening: PostgreSQL takes two
hours to search through the entire long table, returning all false.
From | Date | Subject | |
---|---|---|---|
Next Message | Francisco Olarte | 2024-06-28 07:47:41 | Re: LibPQ doesn't say host=* translates to localhost |
Previous Message | Kedar Joshi | 2024-06-28 05:57:34 | Re: BUG #18478: uuid-ossp extension is not installed with PostgreSQL 17 Beta 1 |