Re: [PERFORM] Does setval(nextval()+N) generate unique blocks of IDs?

2012-08-20 Thread Scott Marlowe
On Mon, Aug 20, 2012 at 6:59 PM, Scott Marlowe wrote: > On Mon, Aug 20, 2012 at 6:10 PM, Tom Lane wrote: >> Craig James writes: >>> I want to do this: >> >>> select setval('object_id_seq', nextval('object_id_seq') + 1000, false); >> >>> Now suppose two processes do this simultaneously. Mayb

Re: [PERFORM] Does setval(nextval()+N) generate unique blocks of IDs?

2012-08-20 Thread Scott Marlowe
On Mon, Aug 20, 2012 at 6:10 PM, Tom Lane wrote: > Craig James writes: >> I want to do this: > >> select setval('object_id_seq', nextval('object_id_seq') + 1000, false); > >> Now suppose two processes do this simultaneously. Maybe they're in >> transactions, maybe they're not. Are they guar

Re: [PERFORM] Does setval(nextval()+N) generate unique blocks of IDs?

2012-08-20 Thread Tom Lane
Craig James writes: > I want to do this: > select setval('object_id_seq', nextval('object_id_seq') + 1000, false); > Now suppose two processes do this simultaneously. Maybe they're in > transactions, maybe they're not. Are they guaranteed to get distinct > blocks of IDs? No, because the s

[PERFORM] Does setval(nextval()+N) generate unique blocks of IDs?

2012-08-20 Thread Craig James
Is seq.setval() "non transactional" in the same sense as seq.nextval() is? More specifically, suppose I sometimes want to get IDs one-by-one using nextval(), but sometimes I want a block of a thousand IDs. To get the latter, I want to do this: select setval('object_id_seq', nextval('object_i

Re: [PERFORM] Increasing WAL usage followed by sudden drop

2012-08-20 Thread delongboy
Jeff Janes wrote > > Maybe there is an easier way, but one thing would be to compile a test > server (of the same version as the production) with WAL_DEBUG defined > in src/include/pg_config_manual.h, turn on the wal_debug guc, and > crank up trace_recovery_messages. Then replay the WAL log file

Re: [PERFORM] 7k records into Sort node, 4.5m out?

2012-08-20 Thread Josh Berkus
> It isn't ... or at least, you've offered no evidence that it is. Sorry, I thought Christophe had sent you the details offlist. Checking ... -- Josh Berkus PostgreSQL Experts Inc. http://pgexperts.com -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make ch

Re: [PERFORM] 7k records into Sort node, 4.5m out?

2012-08-20 Thread Tom Lane
Josh Berkus writes: > I guess what I'm really not understanding is why it's calculating a cost > of 3.7m for the index scan, and then discarding that *entire* cost and > not including it in the total cost of the query? It isn't ... or at least, you've offered no evidence that it is. It's discount