- Notifications
You must be signed in to change notification settings - Fork5
Commit7e0cce0
committed
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 werequite useless in the read case since the snapshot-based tests wereguaranteed to produce the same answer every time. In the write case,the extra tests could in principle detect revocation of write privilegesafter a series of writes has started --- but there's a race condition thereanyway, since we'd check privileges before performing and certainly beforecommitting the write. So there's no real advantage to checking everysingle time, and we might as well redefine it as "only check the firsttime".On the same reasoning, remove the LargeObjectExists checks in inv_writeand inv_truncate. We already checked existence when the descriptor wasopened, and checking again doesn't provide any real increment of safetythat would justify the cost.1 parent2d8c81a commit7e0cce0
File tree
3 files changed
+88
-89
lines changed- src
- backend
- libpq
- storage/large_object
- include/storage
3 files changed
+88
-89
lines changedLines changed: 74 additions & 59 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
157 | 157 |
| |
158 | 158 |
| |
159 | 159 |
| |
| 160 | + | |
160 | 161 |
| |
161 | 162 |
| |
162 | 163 |
| |
163 | 164 |
| |
164 | 165 |
| |
| 166 | + | |
165 | 167 |
| |
166 |
| - | |
167 |
| - | |
168 |
| - | |
169 |
| - | |
170 |
| - | |
171 |
| - | |
172 |
| - | |
173 |
| - | |
174 |
| - | |
175 |
| - | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
176 | 184 |
| |
177 |
| - | |
| 185 | + | |
178 | 186 |
| |
179 | 187 |
| |
180 | 188 |
| |
| |||
183 | 191 |
| |
184 | 192 |
| |
185 | 193 |
| |
| 194 | + | |
186 | 195 |
| |
187 | 196 |
| |
188 | 197 |
| |
189 | 198 |
| |
190 | 199 |
| |
| 200 | + | |
191 | 201 |
| |
192 |
| - | |
| 202 | + | |
193 | 203 |
| |
194 | 204 |
| |
195 | 205 |
| |
196 | 206 |
| |
197 | 207 |
| |
198 |
| - | |
199 |
| - | |
200 |
| - | |
201 |
| - | |
202 |
| - | |
203 |
| - | |
204 |
| - | |
205 |
| - | |
206 |
| - | |
207 |
| - | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
208 | 222 |
| |
209 |
| - | |
| 223 | + | |
210 | 224 |
| |
211 | 225 |
| |
212 | 226 |
| |
| |||
230 | 244 |
| |
231 | 245 |
| |
232 | 246 |
| |
233 |
| - | |
234 |
| - | |
| 247 | + | |
| 248 | + | |
235 | 249 |
| |
236 | 250 |
| |
237 | 251 |
| |
| |||
303 | 317 |
| |
304 | 318 |
| |
305 | 319 |
| |
306 |
| - | |
307 |
| - | |
| 320 | + | |
| 321 | + | |
308 | 322 |
| |
309 | 323 |
| |
310 | 324 |
| |
| |||
558 | 572 |
| |
559 | 573 |
| |
560 | 574 |
| |
561 |
| - | |
562 |
| - | |
| 575 | + | |
| 576 | + | |
563 | 577 |
| |
564 |
| - | |
565 |
| - | |
| 578 | + | |
566 | 579 |
| |
567 | 580 |
| |
568 | 581 |
| |
569 | 582 |
| |
570 | 583 |
| |
| 584 | + | |
571 | 585 |
| |
572 |
| - | |
573 |
| - | |
574 |
| - | |
575 |
| - | |
576 |
| - | |
577 |
| - | |
| 586 | + | |
578 | 587 |
| |
579 |
| - | |
580 |
| - | |
581 |
| - | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
582 | 606 |
| |
583 |
| - | |
| 607 | + | |
| 608 | + | |
584 | 609 |
| |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
585 | 617 |
| |
586 | 618 |
| |
587 | 619 |
| |
| |||
591 | 623 |
| |
592 | 624 |
| |
593 | 625 |
| |
594 |
| - | |
595 |
| - | |
596 |
| - | |
597 |
| - | |
598 |
| - | |
599 |
| - | |
600 |
| - | |
601 |
| - | |
602 |
| - | |
603 |
| - | |
604 |
| - | |
605 |
| - | |
606 |
| - | |
607 |
| - | |
608 |
| - | |
609 |
| - | |
610 |
| - | |
611 |
| - | |
| 626 | + | |
612 | 627 |
| |
613 | 628 |
| |
614 | 629 |
| |
|
Lines changed: 4 additions & 26 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
420 | 420 |
| |
421 | 421 |
| |
422 | 422 |
| |
423 |
| - | |
424 |
| - | |
| 423 | + | |
| 424 | + | |
425 | 425 |
| |
426 | 426 |
| |
427 | 427 |
| |
| |||
562 | 562 |
| |
563 | 563 |
| |
564 | 564 |
| |
565 |
| - | |
566 |
| - | |
567 |
| - | |
568 |
| - | |
569 |
| - | |
570 |
| - | |
571 |
| - | |
572 |
| - | |
573 |
| - | |
574 |
| - | |
575 |
| - | |
576 |
| - | |
| 565 | + | |
577 | 566 |
| |
578 | 567 |
| |
579 | 568 |
| |
| |||
767 | 756 |
| |
768 | 757 |
| |
769 | 758 |
| |
770 |
| - | |
771 |
| - | |
772 |
| - | |
773 |
| - | |
774 |
| - | |
775 |
| - | |
776 |
| - | |
777 |
| - | |
778 |
| - | |
779 |
| - | |
780 |
| - | |
781 |
| - | |
| 759 | + | |
782 | 760 |
| |
783 | 761 |
| |
784 | 762 |
| |
|
Lines changed: 10 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
27 | 27 |
| |
28 | 28 |
| |
29 | 29 |
| |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
30 | 34 |
| |
31 | 35 |
| |
32 | 36 |
| |
| |||
38 | 42 |
| |
39 | 43 |
| |
40 | 44 |
| |
41 |
| - | |
| 45 | + | |
42 | 46 |
| |
43 |
| - | |
44 |
| - | |
45 |
| - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
46 | 52 |
| |
47 | 53 |
| |
48 | 54 |
| |
|
0 commit comments
Comments
(0)