pgsql: Remove unnecessary overhead in backend's large-object operations

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Remove unnecessary overhead in backend's large-object operations
Дата
Msg-id E1TLgZ7-0000Zh-Fw@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Remove unnecessary overhead in backend's large-object operations.

Do read/write permissions checks at most once per large object descriptor,
not once per lo_read or lo_write call as before.  The repeated tests were
quite useless in the read case since the snapshot-based tests were
guaranteed to produce the same answer every time.  In the write case,
the extra tests could in principle detect revocation of write privileges
after a series of writes has started --- but there's a race condition there
anyway, since we'd check privileges before performing and certainly before
committing the write.  So there's no real advantage to checking every
single time, and we might as well redefine it as "only check the first
time".

On the same reasoning, remove the LargeObjectExists checks in inv_write
and inv_truncate.  We already checked existence when the descriptor was
opened, and checking again doesn't provide any real increment of safety
that would justify the cost.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/7e0cce0265921dca2e8ea9485c194465a7e19703

Modified Files
--------------
src/backend/libpq/be-fsstubs.c             |  133 +++++++++++++++------------
src/backend/storage/large_object/inv_api.c |   30 +------
src/include/storage/large_object.h         |   14 ++-
3 files changed, 88 insertions(+), 89 deletions(-)


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: pgsql: Fix thinko in previous commit
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix PGXS support for building loadable modules on AIX.