Re: [HACKERS] Indirect indexes
От | Alvaro Herrera |
---|---|
Тема | Re: [HACKERS] Indirect indexes |
Дата | |
Msg-id | 20161222221800.hxygbzoltapvi2qy@alvherre.pgsql обсуждение исходный текст |
Ответ на | Indirect indexes (Alvaro Herrera <alvherre@2ndquadrant.com>) |
Ответы |
Re: [HACKERS] Indirect indexes
|
Список | pgsql-hackers |
Here's a still-WIP patch that's a better candidate for inclusion. In this patch, I have created an executor node for indirect index scans. This node is created whenever an indexscan path is chosen for an indirect index. The planner treats indirect indexes just like regular indexes, except that they are explicitly excluded from index-only scans and bitmap scans. Indirect indexes are more costly to scan than regular indexes, because of the need to scan the primary key index. However, the fact that they can be ignored for HOT considerations make them worthwhile in update-heavy cases. This patch only implements btree indirect indexes, but it is possible to implement them with other index types too. The btree case is probably not terribly interesting in conjuncttion with Pavan's WARM, but on the other hand it is expected that GIN indirect to remain useful. I have not implemented GIN indirect indexes yet, to keep the patch small; once we have btree indirect indexes we can implement GIN, which should be easy. There are a few broken things yet, such as "REINDEX TABLE pg_class" and some other operations specifically on pg_class. This one in particular breaks the regression tests, but that shouldn't be terribly difficult to fix. Other things I know about that need further work: * The killtuple implementation is bogus: it may delete entries that are visible to scans other than our own (in particular it may delete entries that are being concurrently created, I think). * We still pass PK values in scan->xs_ctup.t_self. Shouldn't be difficult to fix, if a bit invasive. * Only one primary key column is supported. Should be an easy fix if the above is fixed. * Fill in the UNIQUE_CHECK_INSERT_SINGLETON bits, to avoid duplicate entries in the indirect index * Figure out what's the deal with validate_index_heapscan * Figure out if we need to apply ExecQual in IndirectIndexNext * Verify whether NumOrderByKeys != 0 is necessary. If so, test it. * There's a probably bogus assertion in get_index_paths * Better implementation of RelationGetPrimaryKey? Maybe save PK in relcache? -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Вложения
В списке pgsql-hackers по дате отправления: