Re: BufferAccessStrategy for bulk insert

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Robert Haas" <robertmhaas(at)gmail(dot)com>
Cc: "Postgres Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: BufferAccessStrategy for bulk insert
Date: 2008-10-26 19:24:57
Message-ID: 17996.1225049097@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Robert Haas" <robertmhaas(at)gmail(dot)com> writes:
> I am kind of inclined to define flags like this:

> #define HEAP_INSERT_SKIP_WAL 0x0001
> #define HEAP_INSERT_SKIP_FSM 0x0002
> #define HEAP_INSERT_BULK 0x0004 /* do we even need this one? */

> And then:

> Oid heap_insert(Relation relation, HeapTuple tup, CommandId cid,
> unsigned options, BulkInsertState *bistate);
> BulkInsertState *GetBulkInsertState(void);
> void FreeBulkInsertState(BulkInsertState *);

Seems sane to me. I don't see the point of the HEAP_INSERT_BULK flag
bit --- providing or not providing bistate would cover that, and if
you have a bit as well then you have to define what the inconsistent
combinations mean. I concur with making all-zeroes be the typical
state of the flag bits, too.

FWIW, we generally declare bitmask flag variables as int, unless
there's some really good reason to do otherwise.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2008-10-26 20:08:32 Re: new correlation metric
Previous Message Jeff Davis 2008-10-26 18:32:17 array_agg and array_accum (patch)