Assigning fixed OIDs to system catalogs and indexes

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Assigning fixed OIDs to system catalogs and indexes
Дата
Msg-id 29990.1113340741@sss.pgh.pa.us
обсуждение исходный текст
Список pgsql-hackers
While thinking about the use of hand-assigned OIDs for pg_proc and
pg_operator, it occurred to me to wonder why we don't have hand-assigned
OIDs for all system catalogs and indexes.  Currently, most of the time
that the C code wants to reference a specific catalog or index, it has
to reference it by name.  If we had fixed OIDs for all the catalogs and
indexes known to the C code, we could get rid of heap_openr,
index_openr, and the index-by-name maintained inside the relcache,
because *all* such accesses would go by OID.  I don't have hard numbers
to prove it, but I think that the aggregate overhead of doing string
instead of integer comparisons during those lookups has to be
nontrivial.  There are other annoyances such as having to use
get_system_catalog_relid() in many places where a constant would be nice
to have.

The code wouldn't get any less readable -- we'd just be replacing macros
that expand to strings with ones that expand to numbers.

Thoughts?  Anyone have an argument why we should not do this?
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Simplifying bootstrap OID assignment
Следующее
От: "Qingqing Zhou"
Дата:
Сообщение: Re: Assigning fixed OIDs to system catalogs and indexes