diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-12-03 05:51:03 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-12-03 05:51:03 +0000 |
commit | a98871b7ac601b4ebe6ba050b1f9cbfdd5d71ded (patch) | |
tree | 14a0b7c6a91cf05fc5556a6dcb00246ff11b0e6a /src/backend/storage/large_object/inv_api.c | |
parent | 1cf65140d07527e01c56164caefb5eb0c8106480 (diff) | |
download | postgresql-a98871b7ac601b4ebe6ba050b1f9cbfdd5d71ded.tar.gz postgresql-a98871b7ac601b4ebe6ba050b1f9cbfdd5d71ded.zip |
Tweak indexscan machinery to avoid taking an AccessShareLock on an index
if we already have a stronger lock due to the index's table being the
update target table of the query. Same optimization I applied earlier
at the table level. There doesn't seem to be much interest in the more
radical idea of not locking indexes at all, so do what we can ...
Diffstat (limited to 'src/backend/storage/large_object/inv_api.c')
-rw-r--r-- | src/backend/storage/large_object/inv_api.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/storage/large_object/inv_api.c b/src/backend/storage/large_object/inv_api.c index 74409f3cd0a..f6d4cf80457 100644 --- a/src/backend/storage/large_object/inv_api.c +++ b/src/backend/storage/large_object/inv_api.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/storage/large_object/inv_api.c,v 1.113 2005/10/15 02:49:26 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/storage/large_object/inv_api.c,v 1.114 2005/12/03 05:51:02 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -299,7 +299,7 @@ inv_getsize(LargeObjectDesc *obj_desc) BTEqualStrategyNumber, F_OIDEQ, ObjectIdGetDatum(obj_desc->id)); - sd = index_beginscan(lo_heap_r, lo_index_r, + sd = index_beginscan(lo_heap_r, lo_index_r, true, obj_desc->snapshot, 1, skey); /* @@ -410,7 +410,7 @@ inv_read(LargeObjectDesc *obj_desc, char *buf, int nbytes) BTGreaterEqualStrategyNumber, F_INT4GE, Int32GetDatum(pageno)); - sd = index_beginscan(lo_heap_r, lo_index_r, + sd = index_beginscan(lo_heap_r, lo_index_r, true, obj_desc->snapshot, 2, skey); while ((tuple = index_getnext(sd, ForwardScanDirection)) != NULL) @@ -526,7 +526,7 @@ inv_write(LargeObjectDesc *obj_desc, char *buf, int nbytes) BTGreaterEqualStrategyNumber, F_INT4GE, Int32GetDatum(pageno)); - sd = index_beginscan(lo_heap_r, lo_index_r, + sd = index_beginscan(lo_heap_r, lo_index_r, false /* got lock */, obj_desc->snapshot, 2, skey); oldtuple = NULL; |