looking for optimum select for exported keys

Поиск
Список
Период
Сортировка
От Dave Cramer
Тема looking for optimum select for exported keys
Дата
Msg-id 1023198536.1427.234.camel@inspiron.cramers
обсуждение исходный текст
Ответ на Re: Cygwin / Debian dpkg / PostgreSQL / KDE2 and 3  ("Tille, Andreas" <TilleA@rki.de>)
Список pgsql-hackers
The jdbc driver has a method to return the exported keys from a table,
we require essentially what the following select returns, but it is
slow, can anyone suggest ways to optimize it?

Regards,
Dave
SELECT       c.relname as primary,       c2.relname as foreign,       t.tgconstrname,       ic.relname as fkeyname,
 af.attnum as fkeyseq,       ipc.relname as pkeyname,       ap.attnum as pkeyseq,       t.tgdeferrable,
t.tginitdeferred,      t.tgnargs,t.tgargs,       p1.proname as updaterule,       p2.proname as deleterule
 
FROM       pg_trigger t,       pg_trigger t1,       pg_class c,       pg_class c2,       pg_class ic,       pg_class
ipc,      pg_proc p1,       pg_proc p2,       pg_index if,       pg_index ip,       pg_attribute af,       pg_attribute
ap
WHERE       (t.tgrelid=c.oid       AND t.tgisconstraint       AND t.tgconstrrelid=c2.oid       AND t.tgfoid=p1.oid
and p1.proname like '%%upd')
 
       and       (t1.tgrelid=c.oid       and t1.tgisconstraint       and t1.tgconstrrelid=c2.oid       AND
t1.tgfoid=p2.oid      and p2.proname like '%%del')
 
       AND c2.relname='users'
       AND       (if.indrelid=c.oid       AND if.indexrelid=ic.oid       and ic.oid=af.attrelid       AND
if.indisprimary)
       and       (ip.indrelid=c2.oid       and ip.indexrelid=ipc.oid       and ipc.oid=ap.attrelid       and
ip.indisprimary)
;




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

Предыдущее
От: "Tille, Andreas"
Дата:
Сообщение: Re: Cygwin / Debian dpkg / PostgreSQL / KDE2 and 3
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: pgaccess