Re: changeset generation v5-01 - Patches & git tree

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: changeset generation v5-01 - Patches & git tree
Дата
Msg-id 20130628153417.GT3757@eldon.alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: changeset generation v5-01 - Patches & git tree  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: changeset generation v5-01 - Patches & git tree  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-hackers
Robert Haas escribió:
> On Fri, Jun 28, 2013 at 10:49 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> > Robert's idea sounds fairly reasonable to me; another 4 bytes per
> > insert/update/delete WAL entry isn't that big a deal, ...
> 
> How big a deal is it?  This is a serious question, because I don't
> know.  Let's suppose that the average size of an XLOG_HEAP_INSERT
> record is 100 bytes.  Then if we add 4 bytes, isn't that a 4%
> overhead?  And doesn't that seem significant?

An INSERT wal record is:

typedef struct xl_heap_insert
{xl_heaptid    target;            /* inserted tuple id */bool        all_visible_cleared;    /* PD_ALL_VISIBLE was
cleared*//* xl_heap_header & TUPLE DATA FOLLOWS AT END OF STRUCT */
 
} xl_heap_insert;

typedef struct xl_heap_header
{uint16        t_infomask2;uint16        t_infomask;uint8        t_hoff;
} xl_heap_header;

So the fixed part is just 7 bytes + 5 bytes; tuple data follows that.
So adding four more bytes could indeed be significant (but by how much,
depends on the size of the tuple data).  Adding a new pg_class index
would be larger in the sense that there are more WAL records, and
there's the extra vacuuming traffic; but on the other hand that would
only happen when tables are created.  It seems safe to assume that in
normal use cases the ratio of tuple insertion vs. table creation is
large.

The only idea that springs to mind is to have the new pg_class index be
created conditionally, i.e. only when logical replication is going to be
used.

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



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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Department of Redundancy Department: makeNode(FuncCall) division
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Request for Patch Feedback: Lag & Lead Window Functions Can Ignore Nulls