Re: [HACKERS] pgbench: Skipping the creating primary keys afterinitialization - Mailing list pgsql-hackers

From Fabien COELHO
Subject Re: [HACKERS] pgbench: Skipping the creating primary keys afterinitialization
Date
Msg-id alpine.DEB.2.20.1708031820090.16606@lancre
Whole thread Raw
In response to Re: [HACKERS] pgbench: Skipping the creating primary keys after initialization  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [HACKERS] pgbench: Skipping the creating primary keys after initialization
List pgsql-hackers
>> For the CREATE stuff, the script language is SQL, the command to use it is
>> "psql"...
>
>> The real and hard part is to fill tables with meaningful pseudo-random
>> test data which do not violate constraints for any non trivial schema
>> involving foreign keys and various unique constraints.
>
>> The solution for this is SQL for trivial cases, think of:
>>    "INSERT INTO Foo() SELECT ... FROM generate_series(...);"
>
> Yeah.  I was also thinking that complicated data-generation requirements
> could be handled with plpgsql DO blocks, avoiding the need for hard-wired
> code inside pgbench.

I do not thing that it is really be needed for what pgbench does, though. 
See attached attempt, including a no_foreign_keys option.

The only tricky thing is to have the elapsed/remaining advancement report 
on stdout, maybe with some PL/pgSQL.

Timings are very similar compared to "pgbench -i".

-- 
Fabien.
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachment

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: [HACKERS] Tightly packing expressions
Next
From: Robert Haas
Date:
Subject: Re: [HACKERS] A bug in mapping attributes in ATExecAttachPartition()