Re: BufferAccessStrategy for bulk insert - Mailing list pgsql-hackers

From Tom Lane
Subject Re: BufferAccessStrategy for bulk insert
Date
Msg-id 17996.1225049097@sss.pgh.pa.us
Whole thread Raw
In response to BufferAccessStrategy for bulk insert  ("Robert Haas" <robertmhaas@gmail.com>)
Responses Re: BufferAccessStrategy for bulk insert
List pgsql-hackers
"Robert Haas" <robertmhaas@gmail.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


pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: array_agg and array_accum (patch)
Next
From: Jeff Davis
Date:
Subject: Re: new correlation metric