Re: [HACKERS] GSoC 2017: Foreign Key Arrays

Поиск
Список
Период
Сортировка
От Mark Rofail
Тема Re: [HACKERS] GSoC 2017: Foreign Key Arrays
Дата
Msg-id CAJvoCuvgPTPfjCQ383PkMnQ6oFgxY-Z4fXOqzjhmfW9gcoy-fw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] GSoC 2017: Foreign Key Arrays  (Mark Rofail <markm.rofail@gmail.com>)
Ответы Re: [HACKERS] GSoC 2017: Foreign Key Arrays  (Mark Rofail <markm.rofail@gmail.com>)
Список pgsql-hackers
To make the queries fired by the RI triggers GIN indexed. We need to ‒ as Tom Lane has previously suggested[1] ‒ to replace the query 

SELECT 1 FROM ONLY fktable x WHERE $1 = ANY (fkcol) FOR SHARE OF x;

with 

SELECT 1 FROM ONLY fktable x WHERE ARRAY[$1] <@ fkcol FOR SHARE OF x;

but since we have @<(anyarray, anyelement) it can be improved to 

SELECT 1 FROM ONLY fktable x WHERE $1 @> fkcol FOR SHARE OF x;

and the piece of code responsible for all of this is ri_GenerateQual in ri_triggers.c.

How to accomplish that is the next step. I don't know if we should hardcode the "@>" symbol or if we just index the fk table then ri_GenerateQual would be able to find the operator on it's own.

What I plan to do:
  • study how to index the fk table upon its creation. I suspect this can be done in tablecmds.c
Questions:
  • how can you programmatically in C index a table?

Best Regards,
Mark Rofail

Вложения

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

Предыдущее
От: Tatsuo Ishii
Дата:
Сообщение: Re: [HACKERS] SCRAM auth and Pgpool-II
Следующее
От: Amit Langote
Дата:
Сообщение: Re: [HACKERS] Multi column range partition table