forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit81a23dd
committed
Avoid unnecessary table open/close in TRUNCATE command.
ExecuteTruncate() filters out the duplicate tables specifiedin the TRUNCATE command, for example in the case where "TRUNCATE foo, foo"is executed. Such duplicate tables obviously don't need to be openedand closed because they are skipped. But previously it always openedthe tables before checking whether they were duplicated ones or not,and then closed them if they were. That is, the duplicated tables wereopened and closed unnecessarily.This commit changes ExecuteTruncate() so that it opens the tableafter it confirms that table is not duplicated one, which leads toavoid unnecessary table open/close.Do not back-patch because such unnecessary table open/close is nota bug though it exists in older versions.Author: Bharath RupireddyReviewed-by: Amul Sul, Fujii MasaoDiscussion:https://postgr.es/m/CALj2ACUdBO_sXJTa08OZ0YT0qk7F_gAmRa9hT4dxRcgPS4nsZA@mail.gmail.com1 parent08aa89b commit81a23dd
1 file changed
+3
-6
lines changedLines changed: 3 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1639 | 1639 |
| |
1640 | 1640 |
| |
1641 | 1641 |
| |
1642 |
| - | |
1643 |
| - | |
1644 |
| - | |
1645 | 1642 |
| |
1646 | 1643 |
| |
1647 |
| - | |
1648 |
| - | |
1649 | 1644 |
| |
1650 |
| - | |
| 1645 | + | |
| 1646 | + | |
| 1647 | + | |
1651 | 1648 |
| |
1652 | 1649 |
| |
1653 | 1650 |
| |
|
0 commit comments
Comments
(0)