Re: Performance degradation on concurrent COPY into a single relation in PG16.
От | David Rowley |
---|---|
Тема | Re: Performance degradation on concurrent COPY into a single relation in PG16. |
Дата | |
Msg-id | CAApHDvpzO718WH01RVpog1=a+=GcvXXwei8CxHGP01DY1QThXg@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Performance degradation on concurrent COPY into a single relation in PG16. (Dean Rasheed <dean.a.rasheed@gmail.com>) |
Ответы |
Re: Performance degradation on concurrent COPY into a single relation in PG16.
|
Список | pgsql-hackers |
On Wed, 19 Jul 2023 at 23:14, Dean Rasheed <dean.a.rasheed@gmail.com> wrote: > Hmm, I'm somewhat sceptical about this second patch. It's not obvious > why adding such tests would speed it up, and indeed, testing on my > machine with 50M rows, I see a noticeable speed-up from patch 1, and a > slow-down from patch 2: I noticed that 6fcda9aba added quite a lot of conditions that need to be checked before we process a normal decimal integer string. I think we could likely do better and code it to assume that most strings will be decimal and put that case first rather than last. In the attached, I've changed that for the 32-bit version only. A more complete patch would need to do the 16 and 64-bit versions too. -- setup create table a (a int); insert into a select x from generate_series(1,10000000)x; copy a to '~/a.dump'; -- test truncate a; copy a from '/tmp/a.dump'; master @ ab29a7a9c Time: 2152.633 ms (00:02.153) Time: 2121.091 ms (00:02.121) Time: 2100.995 ms (00:02.101) Time: 2101.724 ms (00:02.102) Time: 2103.949 ms (00:02.104) master + pg_strtoint32_base_10_first.patch Time: 2061.464 ms (00:02.061) Time: 2035.513 ms (00:02.036) Time: 2028.356 ms (00:02.028) Time: 2043.218 ms (00:02.043) Time: 2037.035 ms (00:02.037) (~3.6% faster) Without that, we need to check if the first digit is '0' a total of 3 times and also check if the 2nd digit is any of 'x', 'X', 'o', 'O', 'b' or 'B'. It seems to be coded with the assumption that hex strings are the most likely. I think decimals are the most likely by far. David
Вложения
В списке pgsql-hackers по дате отправления: