Re: pg_relation_size locking
От | Alvaro Herrera |
---|---|
Тема | Re: pg_relation_size locking |
Дата | |
Msg-id | 20051212130512.GB19555@surnet.cl обсуждение исходный текст |
Ответ на | pg_relation_size locking (Andreas Pflug <pgadmin@pse-consulting.de>) |
Список | pgsql-hackers |
Andreas Pflug wrote: > Until recently, pg_relation_size used SearchSysCache to locate the > relation to examine, and calculated the file location from that > information. Starting with dbsize.c V1.5 (committed after Beta2), > relation_open(.., AccessShareLock) is used. This is very unfortunate > because it will not allow to observe a table growing while it is > populated, e.g. with a lengthy COPY; pg_relation_size will be blocked. > After reverting to 1.4, everything was fine again. The diff: http://projects.commandprompt.com/projects/public/pgsql/changeset/23120 The problem with the original coding was that it used the table Oid to look up the file name, which is wrong. (Test it with a table that has been clustered or an index that has been reindexed.) We could use a SysCache on filenode, if there was one. Unfortunately I don't think we have it. > Can we have this reverted/fixed? If you can see a way without reintroducing the old bugs, let me know. -- Alvaro Herrera http://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc.
В списке pgsql-hackers по дате отправления: