Re: WIP: Rework access method interface

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: WIP: Rework access method interface
Дата
Msg-id 20151102161606.GD6104@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: WIP: Rework access method interface  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: WIP: Rework access method interface
Список pgsql-hackers
Tom Lane wrote:

> Probably the least messy way to fix this is to drop that #include and
> instead use dummy declarations like "struct PlannerInfo;" and "struct
> IndexPath;" here.  We could additionally dumb the amcostestimate
> declaration down from using "Cost" and "Selectivity" to just saying
> "double".

I'm not a fan of this approach.  I'd rather split the executor headers
in two, a leanone with the typedefs only and another with the actual
struct definitions.  That way we have one very lean executor header that
can be included everywhere (in headers and .c files that only pass the
structs around), and a fat one that is only included by the executor .c
files (and the few extra .c files that need access to the struct
definitions).

This would be similar in spirit to the htup.h / htup_details.h split.

I think (almost?) all the headers that define nodes suffer from this
disease and could be cured in the same way.

> (Note: I realize that there's a precedent in fdwapi.h of including planner
> headers into what's otherwise mostly an executor thing.  That one's not
> quite as destructive to header modularity because it's not used in as many
> places as amapi.h will be.  But maybe we should rethink that as well.)

Yes, rethink++.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



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

Предыдущее
От: Merlin Moncure
Дата:
Сообщение: Re: Request: pg_cancel_backend variant that handles 'idle in transaction' sessions
Следующее
От: Tom Lane
Дата:
Сообщение: Re: ALTER SYSTEM vs symlink