Re: New FSM allocation policy
От | Heikki Linnakangas |
---|---|
Тема | Re: New FSM allocation policy |
Дата | |
Msg-id | 48C0F1E4.5000201@enterprisedb.com обсуждение исходный текст |
Ответ на | Re: New FSM allocation policy (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-hackers |
Tom Lane wrote: > Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes: >> Tom Lane wrote: >>> There may >>> be no very good way to do that without maintaining some shared state, >>> ie the last page handed out. > >> We could put an extra field on the FSM root page. Hmm, it doesn't >> actually need to be a single global field, so we could have a field like >> that on every FSM page, for better concurrency. > > Yeah, that would work, and it is only a hint so you needn't WAL-log > changing it. Done. That seems to have helped a lot with the case of two concurrent backends bulk inserting to a table. I'm now happy with the bulk insert performance and behavior. I've been using the attached test case to measure that. It uses pgbench to measure the speed of bulk inserting one million rows, with these variations: - one client, start with a freshly-created table (i.e FSM is empty, and the table is extended) - same, but with two clients - one client, start with a pre-existing, but empty, table. So all requests for free space are satisfied by the FSM, the table is not extended. - same, but with two clients. Running that test on my laptop, with data directory on a RAM drive to measure just the CPU overhead and concurrency, it looks like the patched version is now on par with the current implementation. Looking at the pattern that pages are filled, by polling pg_freespace('tmp') while the test is running, the pages are being filled sequentially, with the target pages of the two backends interleaved, which is as expected and emulates the behavior of the current implementation. I haven't tried larger I/O bound tests yet, but because the access pattern is now the same as without the patch, I would expect the performance to be comparable. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com
Вложения
В списке pgsql-hackers по дате отправления: