Re: BUG #18978: Index does not work in aggregate function filter

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: BUG #18978: Index does not work in aggregate function filter
Дата
Msg-id CAKFQuwYOmxCjBeyAC1z0AS+Gt=vD_tMhnd10iHzezWxUBQpHig@mail.gmail.com
обсуждение исходный текст
Ответ на BUG #18978: Index does not work in aggregate function filter  (PG Bug reporting form <noreply@postgresql.org>)
Список pgsql-bugs
On Thu, Jul 3, 2025 at 9:23 AM PG Bug reporting form <noreply@postgresql.org> wrote:
The following bug has been logged on the website:

Bug reference:      18978
Logged by:          Jinhui
Email address:      jinhui-lai@foxmail.com
PostgreSQL version: 17.5
Operating system:   ubuntu 22.04
Description:       


explain SELECT COUNT(c1) FILTER (WHERE c1<2) FROM t1;
 
No.  You just need to use a where clause when it is appropriate and a filter when it is appropriate.  A filter clause has no right imposing a restriction on what rows are selected for its level of query - other columns may very well need those rows.

David J.

В списке pgsql-bugs по дате отправления: