- Notifications
You must be signed in to change notification settings - Fork5
Commit5374d09
committed
Change planner to use the current true disk file size as its estimate of
a relation's number of blocks, rather than the possibly-obsolete valuein pg_class.relpages. Scale the value in pg_class.reltuples correspondinglyto arrive at a hopefully more accurate number of rows. When pg_classcontains 0/0, estimate a tuple width from the column datatypes and dividethat into current file size to estimate number of rows. This improvedmethodology allows us to jettison the ancient hacks that put bogus defaultvalues into pg_class when a table is first created. Also, per a suggestionfrom Simon, make VACUUM (but not VACUUM FULL or ANALYZE) adjust the valueit puts into pg_class.reltuples to try to represent the mean tuple densityinstead of the minimal density that actually prevails just after VACUUM.These changes alter the plans selected for certain regression tests, soupdate the expected files accordingly. (I removed join_1.out becauseit's not clear if it still applies; we can add back any variant versionsas they are shown to be needed.)1 parentb7bcea6 commit5374d09
File tree
18 files changed
+1221
-3172
lines changed- doc/src/sgml
- src
- backend
- access/nbtree
- catalog
- commands
- optimizer/util
- include
- access
- nodes
- test/regress/expected
18 files changed
+1221
-3172
lines changedLines changed: 6 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | 2 |
| |
3 |
| - | |
| 3 | + | |
4 | 4 |
| |
5 | 5 |
| |
6 | 6 |
| |
| |||
1079 | 1079 |
| |
1080 | 1080 |
| |
1081 | 1081 |
| |
1082 |
| - | |
| 1082 | + | |
1083 | 1083 |
| |
1084 | 1084 |
| |
1085 | 1085 |
| |
1086 |
| - | |
| 1086 | + | |
| 1087 | + | |
1087 | 1088 |
| |
1088 | 1089 |
| |
1089 | 1090 |
| |
| |||
1095 | 1096 |
| |
1096 | 1097 |
| |
1097 | 1098 |
| |
1098 |
| - | |
| 1099 | + | |
| 1100 | + | |
1099 | 1101 |
| |
1100 | 1102 |
| |
1101 | 1103 |
| |
|
Lines changed: 25 additions & 25 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 |
| - | |
| 2 | + | |
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
6 | 6 |
| |
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
10 |
| - | |
11 |
| - | |
12 |
| - | |
13 |
| - | |
14 |
| - | |
| 10 | + | |
15 | 11 |
| |
16 | 12 |
| |
17 | 13 |
| |
| |||
23 | 19 |
| |
24 | 20 |
| |
25 | 21 |
| |
26 |
| - | |
27 |
| - | |
28 |
| - | |
29 |
| - | |
30 |
| - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
31 | 28 |
| |
32 | 29 |
| |
33 | 30 |
| |
| |||
45 | 42 |
| |
46 | 43 |
| |
47 | 44 |
| |
48 |
| - | |
49 |
| - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
50 | 50 |
| |
51 | 51 |
| |
52 | 52 |
| |
53 | 53 |
| |
54 |
| - | |
55 |
| - | |
| 54 | + | |
56 | 55 |
| |
57 | 56 |
| |
58 |
| - | |
59 |
| - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
60 | 63 |
| |
61 | 64 |
| |
62 | 65 |
| |
| |||
74 | 77 |
| |
75 | 78 |
| |
76 | 79 |
| |
77 |
| - | |
| 80 | + | |
78 | 81 |
| |
79 | 82 |
| |
80 | 83 |
| |
| |||
113 | 116 |
| |
114 | 117 |
| |
115 | 118 |
| |
116 |
| - | |
117 |
| - | |
118 |
| - | |
119 |
| - | |
120 |
| - | |
121 |
| - | |
122 |
| - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
123 | 123 |
| |
124 | 124 |
| |
125 | 125 |
| |
|
Lines changed: 8 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 |
| - | |
| 2 | + | |
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
| |||
389 | 389 |
| |
390 | 390 |
| |
391 | 391 |
| |
392 |
| - | |
393 |
| - | |
394 |
| - | |
395 |
| - | |
396 |
| - | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
397 | 395 |
| |
398 | 396 |
| |
399 |
| - | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
400 | 401 |
| |
401 | 402 |
| |
402 | 403 |
| |
|
Lines changed: 19 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 |
| - | |
| 2 | + | |
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
| |||
527 | 527 |
| |
528 | 528 |
| |
529 | 529 |
| |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
530 | 548 |
| |
531 | 549 |
| |
532 | 550 |
| |
|
Lines changed: 5 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
15 |
| - | |
| 15 | + | |
16 | 16 |
| |
17 | 17 |
| |
18 | 18 |
| |
| |||
785 | 785 |
| |
786 | 786 |
| |
787 | 787 |
| |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
788 | 792 |
| |
789 | 793 |
| |
790 | 794 |
| |
|
Lines changed: 7 additions & 22 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
607 | 607 |
| |
608 | 608 |
| |
609 | 609 |
| |
610 |
| - | |
611 |
| - | |
612 |
| - | |
613 |
| - | |
614 |
| - | |
615 |
| - | |
616 |
| - | |
617 |
| - | |
618 |
| - | |
619 |
| - | |
620 |
| - | |
621 |
| - | |
622 |
| - | |
623 |
| - | |
624 |
| - | |
625 |
| - | |
626 |
| - | |
627 |
| - | |
628 | 610 |
| |
629 | 611 |
| |
630 | 612 |
| |
631 | 613 |
| |
632 | 614 |
| |
633 |
| - | |
634 |
| - | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
635 | 618 |
| |
636 | 619 |
| |
| 620 | + | |
637 | 621 |
| |
638 | 622 |
| |
639 | 623 |
| |
640 |
| - | |
| 624 | + | |
| 625 | + | |
641 | 626 |
| |
642 | 627 |
| |
643 | 628 |
| |
|
Lines changed: 8 additions & 49 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
33 | 33 |
| |
34 | 34 |
| |
35 | 35 |
| |
36 |
| - | |
37 | 36 |
| |
38 |
| - | |
39 | 37 |
| |
40 | 38 |
| |
41 | 39 |
| |
42 | 40 |
| |
43 |
| - | |
44 | 41 |
| |
45 |
| - | |
46 | 42 |
| |
47 | 43 |
| |
48 | 44 |
| |
49 |
| - | |
50 | 45 |
| |
51 | 46 |
| |
52 | 47 |
| |
53 | 48 |
| |
54 | 49 |
| |
55 | 50 |
| |
56 | 51 |
| |
57 |
| - | |
58 |
| - | |
59 |
| - | |
60 |
| - | |
61 |
| - | |
62 |
| - | |
63 |
| - | |
64 |
| - | |
65 | 52 |
| |
66 | 53 |
| |
67 | 54 |
| |
| |||
1153 | 1140 |
| |
1154 | 1141 |
| |
1155 | 1142 |
| |
| 1143 | + | |
| 1144 | + | |
1156 | 1145 |
| |
1157 | 1146 |
| |
1158 | 1147 |
| |
| |||
1170 | 1159 |
| |
1171 | 1160 |
| |
1172 | 1161 |
| |
1173 |
| - | |
| 1162 | + | |
1174 | 1163 |
| |
1175 | 1164 |
| |
1176 | 1165 |
| |
| |||
1209 | 1198 |
| |
1210 | 1199 |
| |
1211 | 1200 |
| |
1212 |
| - | |
| 1201 | + | |
| 1202 | + | |
1213 | 1203 |
| |
1214 | 1204 |
| |
1215 | 1205 |
| |
| |||
1245 | 1235 |
| |
1246 | 1236 |
| |
1247 | 1237 |
| |
1248 |
| - | |
1249 |
| - | |
1250 |
| - | |
1251 |
| - | |
1252 |
| - | |
1253 |
| - | |
1254 |
| - | |
1255 |
| - | |
1256 |
| - | |
1257 |
| - | |
1258 |
| - | |
1259 |
| - | |
1260 |
| - | |
1261 |
| - | |
1262 |
| - | |
1263 |
| - | |
1264 |
| - | |
1265 |
| - | |
1266 |
| - | |
1267 |
| - | |
1268 |
| - | |
1269 |
| - | |
1270 |
| - | |
1271 |
| - | |
1272 |
| - | |
1273 |
| - | |
1274 |
| - | |
1275 |
| - | |
1276 |
| - | |
1277 |
| - | |
1278 |
| - | |
1279 |
| - | |
1280 |
| - | |
1281 | 1238 |
| |
1282 | 1239 |
| |
1283 | 1240 |
| |
1284 | 1241 |
| |
1285 | 1242 |
| |
1286 | 1243 |
| |
| 1244 | + | |
| 1245 | + | |
1287 | 1246 |
| |
1288 | 1247 |
| |
1289 | 1248 |
| |
|
0 commit comments
Comments
(0)