Re: CUBE seems a bit confused about ORDER BY

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Teodor Sigaev <teodor(at)sigaev(dot)ru>
Cc: Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, Andrey Borodin <x4mmm(at)yandex-team(dot)ru>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: CUBE seems a bit confused about ORDER BY
Date: 2018-01-10 17:02:04
Message-ID: 20180110170204.ft3kayxk73ntwxl7@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Teodor Sigaev wrote:

> SQL-query seems too huge for release notes and isn't looking for
> materialized view (fixable) and functional indexes with function which
> contains this operator somewhere inside (not fixable by this query). I
> think, just words is enough.

But the query can be made a little bit shorter and more comprehensible:

SELECT pg_describe_object(dep.classid, dep.objid, dep.objsubid)
FROM pg_catalog.pg_extension ext
JOIN pg_catalog.pg_depend edep ON edep.refobjid = ext.oid
JOIN pg_catalog.pg_operator oper ON oper.oid = edep.objid
JOIN pg_catalog.pg_depend dep ON dep.refobjid = oper.oid
WHERE
ext.extname = 'cube' AND
edep.refclassid = 'pg_catalog.pg_extension'::regclass AND
edep.classid = 'pg_catalog.pg_operator'::regclass AND
edep.deptype = 'e' AND
oper.oprname = '~>' AND
dep.refclassid = 'pg_catalog.pg_operator'::regclass
;

which returns the following

pg_describe_object
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
regla «_RETURN» en vista materializada f
índice tmp_idx
restricción «tmp_c_check» en tabla tmp
operador 15 (cube, integer) de familia de operadores gist_cube_ops para el método de acceso gist: ~>(cube,integer)
(4 filas)

(after
create materialized view f as select * from tmp where c~>1 > 1;
)

I think this is useful enough. The fact remains that we can't check
very well for functions; maybe suggest a LIKE clause to look for ~>
anywhere in function source code?

(It looks like you could get rid of the 'deptype' qual and
dep.refclassid also)

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2018-01-10 17:14:34 Re: [HACKERS] SQL/JSON in PostgreSQL
Previous Message Peter Eisentraut 2018-01-10 16:59:40 Re: portal pinning