>> create index t_idx on t((c+d)); >> select * from t where c+d > 0; Why not : select ((select * from t where c<>0::bigint) UNION (select * from t where d<>0::bigint)) group by whatever; or someting ?
pgsql-performance by date:
Соглашаюсь с условиями обработки персональных данных