Re: refactoring relation extension and BufferAlloc(), faster COPY

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: refactoring relation extension and BufferAlloc(), faster COPY
Дата
Msg-id 20230503212545.ivxaejwfqrpv264m@awork3.anarazel.de
обсуждение исходный текст
Ответ на Re: refactoring relation extension and BufferAlloc(), faster COPY  (Muhammad Malik <muhammad.malik1@hotmail.com>)
Список pgsql-hackers
Hi,

On 2023-05-03 19:29:46 +0000, Muhammad Malik wrote:
> > I use a script like:
>
> > c=16;psql -c 'DROP TABLE IF EXISTS copytest_0; CREATE TABLE copytest_0(data text not null);' && time
/srv/dev/build/m-opt/src/bin/pgbench/pgbench-n -P1 -c$c -j$c -t$((1024/$c)) -f ~/tmp/copy.sql && psql -c 'TRUNCATE
copytest_0'
>
> > >[1] COPY (SELECT repeat(random()::text, 5) FROM generate_series(1, 100000)) TO '/tmp/copytest_data_text.copy' WITH
(FORMATtest);
 
> > >[2] COPY (SELECT repeat(random()::text, 5) FROM generate_series(1, 6*100000)) TO '/tmp/copytest_data_text.copy'
WITH(FORMAT text);
 
>
> When I ran this script it did not insert anything into the copytest_0 table. It only generated a single
copytest_data_text.copyfile of size 9.236MB.
 
> Please help me understand how is this 'pgbench running COPY into a single table'.

That's the data generation for the file to be COPYed in. The script passed to
pgbench is just something like

COPY copytest_0 FROM '/tmp/copytest_data_text.copy';
or
COPY copytest_0 FROM '/tmp/copytest_data_binary.copy';


> Also what are the 'seconds' and 'tbl-MBs' metrics that were reported.

The total time for inserting N (1024 for the small files, 64 for the larger
ones). "tbl-MBs" is size of the resulting table, divided by time. I.e. a
measure of throughput.

Greetings,

Andres Freund



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

Предыдущее
От: Paul Jungwirth
Дата:
Сообщение: Re: SQL:2011 application time
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: Overhauling "Routine Vacuuming" docs, particularly its handling of freezing