relscan.h split

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема relscan.h split
Дата
Msg-id 20080612164043.GG5534@alvh.no-ip.org
обсуждение исходный текст
Ответы Re: relscan.h split
Список pgsql-patches
Hi,

relscan.h is very widely used -- in particular it is included by some
headers that want the IndexScanDesc and HeapScanDesc definitions in
prototypes.  However, most of the time they are just passing the struct
through; they don't need to see the actual Heap/IndexScanDescData
definitions.

I propose the following patch which moves the struct definitions to a
separate new header relscan_internal.h.  Files that actually need the
definitions can include the new header.  They are not that many -- I
count 22 inclusions, all of them in .c files.  Headers only include the
.h file, which has the benefit that since it is a lean file, it needn't
include all the other headers needed by the struct declaration.

Zdenek says that this patch changes the number of times certain headers
are opened (data gathered using dtrace):

                                new     old     diff
src/include/access/skey.h       347     465     -118
src/include/utils/rel.h         851     921     -70
src/include/access/relscan.h    340     360     -20

So it doesn't have a tremendous impact, but it does have some.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: SQL: table function support
Следующее
От: Tom Lane
Дата:
Сообщение: Re: relscan.h split