mirror of
https://github.com/postgres/postgres.git
synced 2026-03-13 14:14:09 -04:00
Currently, in read committed transaction isolation mode (default), we have the following sequence of actions when tuple_update()/tuple_delete() finds the tuple updated by concurrent transaction. 1. Attempt to update/delete tuple with tuple_update()/tuple_delete(), which returns TM_Updated. 2. Lock tuple with tuple_lock(). 3. Re-evaluate plan qual (recheck if we still need to update/delete and calculate the new tuple for update). 4. Second attempt to update/delete tuple with tuple_update()/tuple_delete(). This attempt should be successful, since the tuple was previously locked. This patch eliminates step 2 by taking the lock during first tuple_update()/tuple_delete() call. Heap table access method saves some efforts by checking the updated tuple once instead of twice. Future undo-based table access methods, which will start from the latest row version, can immediately place a lock there. The code in nodeModifyTable.c is simplified by removing the nested switch/case. Discussion: https://postgr.es/m/CAPpHfdua-YFw3XTprfutzGp28xXLigFtzNbuFY8yPhqeq6X5kg%40mail.gmail.com Reviewed-by: Aleksander Alekseev, Pavel Borisov, Vignesh C, Mason Sharp Reviewed-by: Andres Freund, Chris Travers |
||
|---|---|---|
| .. | ||
| ci | ||
| editors | ||
| ifaddrs | ||
| msvc | ||
| perlcheck | ||
| pg_bsd_indent | ||
| pginclude | ||
| pgindent | ||
| ccsym | ||
| check_bison_recursion.pl | ||
| codelines | ||
| copyright.pl | ||
| darwin_sysroot | ||
| find_badmacros | ||
| find_meson | ||
| find_static | ||
| find_typedef | ||
| fix-old-flex-code.pl | ||
| gen_export.pl | ||
| gen_keywordlist.pl | ||
| git-external-diff | ||
| git_changelog | ||
| install_test_files | ||
| make_ctags | ||
| make_etags | ||
| make_mkid | ||
| mark_pgdllimport.pl | ||
| PerfectHash.pm | ||
| pgflex | ||
| pgtest | ||
| rcgen | ||
| RELEASE_CHANGES | ||
| testint128.c | ||
| testwrap | ||
| valgrind.supp | ||
| version_stamp.pl | ||
| win32tzlist.pl | ||