Skip site navigation (1) Skip section navigation (2)

Re: splitting htup.h

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: splitting htup.h
Date: 2012-08-28 20:54:10
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Here's a third version with which I'm much happier.

This patch is mainly doing four things:

1. take some typedefs and the HeapTupleData struct definition from
access/htup.h, and put them in access/tupbasics.h.  This new file is
used as #include in all headers instead of htup.h.

2. take out catcache.h from syscache.h; in its stead, we add a forward
struct declaration of struct catclist.  This was proposed by Andres
Freund and Peter Geogeghan previously, and it turns out to be convenient
as well as foreseen by older comments in syscache.h.  It limits
proliferation of other unnecessary headers in catcache.h as well.

3. split resowner.h creating resowner_private.h.  Files that just want
to create and use ResourceOwners can include the thinner resowner.h;
those that have stuff managed within a ResOwner use the other file.
This limits proliferation of lots of other header inclusion.

4. split the Xlog stuff out of heapam.h into heapam_xlog.h.

The number of src/backend files that depend on some src/include/ files:

access/heapam.h	216
access/heapam_xlog.h	12
access/htup.h	182
access/tupbasics.h	401
utils/resowner.h	74
utils/resowner_private.h	10
utils/catcache.h	23
utils/syscache.h	230

It seems pretty clear that all these the splits are useful.

I'm unsure about the "tupbasics.h" file name.  I'm open to better ideas.
The other two new files seem good enough that no bikeshedding seems
really necessary.

Álvaro Herrera      
PostgreSQL Development, 24x7 Support, Training & Services

Attachment: tupbasics-3.patch
Description: application/octet-stream (103.3 KB)

In response to


pgsql-hackers by date

Next:From: Jim NasbyDate: 2012-08-28 21:02:38
Subject: Re: temporal support patch
Previous:From: Tom LaneDate: 2012-08-28 20:47:26
Subject: Re: MySQL search query is not executing in Postgres DB

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group