aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/json.c
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2013-12-19 16:39:59 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2013-12-19 16:39:59 -0300
commit85d3b3c3ac16ea7d8f7b513d8ac7bc2f88bb988f (patch)
tree174366a14a21fec70b3da5fa01beff084f9b4975 /src/backend/utils/adt/json.c
parentdb1014bc46de21a6de1751b807ea084e607104ad (diff)
downloadpostgresql-85d3b3c3ac16ea7d8f7b513d8ac7bc2f88bb988f.tar.gz
postgresql-85d3b3c3ac16ea7d8f7b513d8ac7bc2f88bb988f.zip
Optimize updating a row that's locked by same xid
Updating or locking a row that was already locked by the same transaction under the same Xid caused a MultiXact to be created; but this is unnecessary, because there's no usefulness in being able to differentiate two locks by the same transaction. In particular, if a transaction executed SELECT FOR UPDATE followed by an UPDATE that didn't modify columns of the key, we would dutifully represent the resulting combination as a multixact -- even though a single key-update is sufficient. Optimize the case so that only the strongest of both locks/updates is represented in Xmax. This can save some Xmax's from becoming MultiXacts, which can be a significant optimization. This missed optimization opportunity was spotted by Andres Freund while investigating a bug reported by Oliver Seemann in message CANCipfpfzoYnOz5jj=UZ70_R=CwDHv36dqWSpwsi27vpm1z5sA@mail.gmail.com and also directly as a performance regression reported by Dong Ye in message d54b8387.000012d8.00000010@YED-DEVD1.vmware.com Reportedly, this patch fixes the performance regression. Since the missing optimization was reported as a significant performance regression from 9.2, backpatch to 9.3. Andres Freund, tweaked by Álvaro Herrera
Diffstat (limited to 'src/backend/utils/adt/json.c')
0 files changed, 0 insertions, 0 deletions