1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
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
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
|
From Inoue@tpf.co.jp Tue Jan 18 19:08:30 2000
Received: from sd.tpf.co.jp (sd.tpf.co.jp [210.161.239.34])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id UAA10148
for <pgman@candle.pha.pa.us>; Tue, 18 Jan 2000 20:08:27 -0500 (EST)
Received: from cadzone ([126.0.1.40] (may be forged))
by sd.tpf.co.jp (2.5 Build 2640 (Berkeley 8.8.6)/8.8.4) with SMTP
id KAA02790; Wed, 19 Jan 2000 10:08:02 +0900
From: "Hiroshi Inoue" <Inoue@tpf.co.jp>
To: "Bruce Momjian" <pgman@candle.pha.pa.us>
Cc: "pgsql-hackers" <pgsql-hackers@postgreSQL.org>
Subject: RE: [HACKERS] Index recreation in vacuum
Date: Wed, 19 Jan 2000 10:13:40 +0900
Message-ID: <000201bf621a$6b9baf20$2801007e@tpf.co.jp>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
Importance: Normal
In-Reply-To: <200001181821.NAA02988@candle.pha.pa.us>
Status: ORr
> -----Original Message-----
> From: Bruce Momjian [mailto:pgman@candle.pha.pa.us]
>
> [Charset iso-8859-1 unsupported, filtering to ASCII...]
> > Hi all,
> >
> > I'm trying to implement REINDEX command.
> >
> > REINDEX operation itself is available everywhere and
> > I've thought about applying it to VACUUM.
>
> That is a good idea. Vacuuming of indexes can be very slow.
>
> > .
> > My plan is as follows.
> >
> > Add a new option to force index recreation in vacuum
> > and if index recreation is specified.
>
> Couldn't we auto-recreate indexes based on the number of tuples moved by
> vacuum,
Yes,we could probably do it. But I'm not sure the availability of new
vacuum.
New vacuum would give us a big advantage that
1) Much faster than current if vacuum remove/moves many tuples.
2) Does shrink index files
But in case of abort/crash
1) couldn't choose index scan for the table
2) unique constraints of the table would be lost
I don't know how people estimate this disadvantage.
>
> > Now I'm inclined to use relhasindex of pg_class to
> > validate/invalidate indexes of a table at once.
>
> There are a few calls to CatalogIndexInsert() that know the
> system table they
> are using and know it has indexes, so it does not check that field. You
> could add cases for that.
>
I think there aren't so many places to check.
I would examine it if my idea is OK.
Regards.
Hiroshi Inoue
Inoue@tpf.co.jp
From owner-pgsql-hackers@hub.org Tue Jan 18 19:15:27 2000
Received: from hub.org (hub.org [216.126.84.1])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id UAA10454
for <pgman@candle.pha.pa.us>; Tue, 18 Jan 2000 20:15:26 -0500 (EST)
Received: from localhost (majordom@localhost)
by hub.org (8.9.3/8.9.3) with SMTP id UAA42280;
Tue, 18 Jan 2000 20:10:35 -0500 (EST)
(envelope-from owner-pgsql-hackers)
Received: by hub.org (bulk_mailer v1.5); Tue, 18 Jan 2000 20:10:30 -0500
Received: (from majordom@localhost)
by hub.org (8.9.3/8.9.3) id UAA42081
for pgsql-hackers-outgoing; Tue, 18 Jan 2000 20:09:31 -0500 (EST)
(envelope-from owner-pgsql-hackers@postgreSQL.org)
Received: from sd.tpf.co.jp (sd.tpf.co.jp [210.161.239.34])
by hub.org (8.9.3/8.9.3) with ESMTP id UAA41943
for <pgsql-hackers@postgreSQL.org>; Tue, 18 Jan 2000 20:08:39 -0500 (EST)
(envelope-from Inoue@tpf.co.jp)
Received: from cadzone ([126.0.1.40] (may be forged))
by sd.tpf.co.jp (2.5 Build 2640 (Berkeley 8.8.6)/8.8.4) with SMTP
id KAA02790; Wed, 19 Jan 2000 10:08:02 +0900
From: "Hiroshi Inoue" <Inoue@tpf.co.jp>
To: "Bruce Momjian" <pgman@candle.pha.pa.us>
Cc: "pgsql-hackers" <pgsql-hackers@postgreSQL.org>
Subject: RE: [HACKERS] Index recreation in vacuum
Date: Wed, 19 Jan 2000 10:13:40 +0900
Message-ID: <000201bf621a$6b9baf20$2801007e@tpf.co.jp>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
Importance: Normal
In-Reply-To: <200001181821.NAA02988@candle.pha.pa.us>
Sender: owner-pgsql-hackers@postgreSQL.org
Status: OR
> -----Original Message-----
> From: Bruce Momjian [mailto:pgman@candle.pha.pa.us]
>
> [Charset iso-8859-1 unsupported, filtering to ASCII...]
> > Hi all,
> >
> > I'm trying to implement REINDEX command.
> >
> > REINDEX operation itself is available everywhere and
> > I've thought about applying it to VACUUM.
>
> That is a good idea. Vacuuming of indexes can be very slow.
>
> > .
> > My plan is as follows.
> >
> > Add a new option to force index recreation in vacuum
> > and if index recreation is specified.
>
> Couldn't we auto-recreate indexes based on the number of tuples moved by
> vacuum,
Yes,we could probably do it. But I'm not sure the availability of new
vacuum.
New vacuum would give us a big advantage that
1) Much faster than current if vacuum remove/moves many tuples.
2) Does shrink index files
But in case of abort/crash
1) couldn't choose index scan for the table
2) unique constraints of the table would be lost
I don't know how people estimate this disadvantage.
>
> > Now I'm inclined to use relhasindex of pg_class to
> > validate/invalidate indexes of a table at once.
>
> There are a few calls to CatalogIndexInsert() that know the
> system table they
> are using and know it has indexes, so it does not check that field. You
> could add cases for that.
>
I think there aren't so many places to check.
I would examine it if my idea is OK.
Regards.
Hiroshi Inoue
Inoue@tpf.co.jp
************
From owner-pgsql-hackers@hub.org Tue Jan 18 19:57:21 2000
Received: from hub.org (hub.org [216.126.84.1])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id UAA11764
for <pgman@candle.pha.pa.us>; Tue, 18 Jan 2000 20:57:19 -0500 (EST)
Received: from localhost (majordom@localhost)
by hub.org (8.9.3/8.9.3) with SMTP id UAA50653;
Tue, 18 Jan 2000 20:52:38 -0500 (EST)
(envelope-from owner-pgsql-hackers)
Received: by hub.org (bulk_mailer v1.5); Tue, 18 Jan 2000 20:52:30 -0500
Received: (from majordom@localhost)
by hub.org (8.9.3/8.9.3) id UAA50513
for pgsql-hackers-outgoing; Tue, 18 Jan 2000 20:51:32 -0500 (EST)
(envelope-from owner-pgsql-hackers@postgreSQL.org)
Received: from candle.pha.pa.us (pgman@s5-03.ppp.op.net [209.152.195.67])
by hub.org (8.9.3/8.9.3) with ESMTP id UAA50462
for <pgsql-hackers@postgreSQL.org>; Tue, 18 Jan 2000 20:51:06 -0500 (EST)
(envelope-from pgman@candle.pha.pa.us)
Received: (from pgman@localhost)
by candle.pha.pa.us (8.9.0/8.9.0) id UAA11421;
Tue, 18 Jan 2000 20:50:50 -0500 (EST)
From: Bruce Momjian <pgman@candle.pha.pa.us>
Message-Id: <200001190150.UAA11421@candle.pha.pa.us>
Subject: Re: [HACKERS] Index recreation in vacuum
In-Reply-To: <000201bf621a$6b9baf20$2801007e@tpf.co.jp> from Hiroshi Inoue at
"Jan 19, 2000 10:13:40 am"
To: Hiroshi Inoue <Inoue@tpf.co.jp>
Date: Tue, 18 Jan 2000 20:50:50 -0500 (EST)
CC: pgsql-hackers <pgsql-hackers@postgreSQL.org>
X-Mailer: ELM [version 2.4ME+ PL66 (25)]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Sender: owner-pgsql-hackers@postgreSQL.org
Status: ORr
> > > Add a new option to force index recreation in vacuum
> > > and if index recreation is specified.
> >
> > Couldn't we auto-recreate indexes based on the number of tuples moved by
> > vacuum,
>
> Yes,we could probably do it. But I'm not sure the availability of new
> vacuum.
>
> New vacuum would give us a big advantage that
> 1) Much faster than current if vacuum remove/moves many tuples.
> 2) Does shrink index files
>
> But in case of abort/crash
> 1) couldn't choose index scan for the table
> 2) unique constraints of the table would be lost
>
> I don't know how people estimate this disadvantage.
That's why I was recommending rename(). The actual window of
vunerability goes from perhaps hours to fractions of a second.
In fact, if I understand this right, you could make the vulerability
zero by just performing the rename as one operation.
In fact, for REINDEX cases where you don't have a lock on the entire
table as you do in vacuum, you could reindex the table with a simple
read-lock on the base table and index, and move the new index into place
with the users seeing no change. Only people traversing the index
during the change would have a problem. You just need an exclusive
access on the index for the duration of the rename() so no one is
traversing the index during the rename().
Destroying the index and recreating opens a large time span that there
is no index, and you have to jury-rig something so people don't try to
use the index. With rename() you just put the new index in place with
one operation. Just don't let people traverse the index during the
change. The pointers to the heap tuples is the same in both indexes.
In fact, with WAL, we will allow multiple physical files for the same
table by appending the table oid to the file name. In this case, the
old index could be deleted by rename, and people would continue to use
the old index until they deleted the open file pointers. Not sure how
this works in practice because new tuples would not be inserted into the
old copy of the index.
--
Bruce Momjian | http://www.op.net/~candle
pgman@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
************
From pgman Tue Jan 18 20:04:11 2000
Received: (from pgman@localhost)
by candle.pha.pa.us (8.9.0/8.9.0) id VAA11990;
Tue, 18 Jan 2000 21:04:11 -0500 (EST)
From: Bruce Momjian <pgman>
Message-Id: <200001190204.VAA11990@candle.pha.pa.us>
Subject: Re: [HACKERS] Index recreation in vacuum
In-Reply-To: <200001190150.UAA11421@candle.pha.pa.us> from Bruce Momjian at "Jan
18, 2000 08:50:50 pm"
To: Bruce Momjian <pgman@candle.pha.pa.us>
Date: Tue, 18 Jan 2000 21:04:11 -0500 (EST)
CC: Hiroshi Inoue <Inoue@tpf.co.jp>,
pgsql-hackers <pgsql-hackers@postgreSQL.org>
X-Mailer: ELM [version 2.4ME+ PL66 (25)]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Status: OR
> > I don't know how people estimate this disadvantage.
>
> That's why I was recommending rename(). The actual window of
> vunerability goes from perhaps hours to fractions of a second.
>
> In fact, if I understand this right, you could make the vulerability
> zero by just performing the rename as one operation.
>
> In fact, for REINDEX cases where you don't have a lock on the entire
> table as you do in vacuum, you could reindex the table with a simple
> read-lock on the base table and index, and move the new index into place
> with the users seeing no change. Only people traversing the index
> during the change would have a problem. You just need an exclusive
> access on the index for the duration of the rename() so no one is
> traversing the index during the rename().
>
> Destroying the index and recreating opens a large time span that there
> is no index, and you have to jury-rig something so people don't try to
> use the index. With rename() you just put the new index in place with
> one operation. Just don't let people traverse the index during the
> change. The pointers to the heap tuples is the same in both indexes.
>
> In fact, with WAL, we will allow multiple physical files for the same
> table by appending the table oid to the file name. In this case, the
> old index could be deleted by rename, and people would continue to use
> the old index until they deleted the open file pointers. Not sure how
> this works in practice because new tuples would not be inserted into the
> old copy of the index.
Maybe I am all wrong here. Maybe most of the advantage of rename() are
meaningless with reindex using during vacuum, which is the most
important use of reindex.
Let's look at index using during vacuum. Right now, how does vacuum
handle indexes when it moves a tuple? Does it do each index update as
it moves a tuple? Is that why it is so slow?
If we don't do that and vacuum fails, what state is the table left in?
If we don't update the index for every tuple, the index is invalid in a
vacuum failure. rename() is not going to help us here. It keeps the
old index around, but the index is invalid anyway, right?
--
Bruce Momjian | http://www.op.net/~candle
pgman@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
From Inoue@tpf.co.jp Tue Jan 18 20:18:48 2000
Received: from sd.tpf.co.jp (sd.tpf.co.jp [210.161.239.34])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id VAA12437
for <pgman@candle.pha.pa.us>; Tue, 18 Jan 2000 21:18:46 -0500 (EST)
Received: from cadzone ([126.0.1.40] (may be forged))
by sd.tpf.co.jp (2.5 Build 2640 (Berkeley 8.8.6)/8.8.4) with SMTP
id LAA02845; Wed, 19 Jan 2000 11:18:18 +0900
From: "Hiroshi Inoue" <Inoue@tpf.co.jp>
To: "Bruce Momjian" <pgman@candle.pha.pa.us>
Cc: "pgsql-hackers" <pgsql-hackers@postgreSQL.org>
Subject: RE: [HACKERS] Index recreation in vacuum
Date: Wed, 19 Jan 2000 11:23:55 +0900
Message-ID: <000801bf6224$3bfdd9a0$2801007e@tpf.co.jp>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
Importance: Normal
In-Reply-To: <200001190204.VAA11990@candle.pha.pa.us>
Status: ORr
> -----Original Message-----
> From: Bruce Momjian [mailto:pgman@candle.pha.pa.us]
>
> > > I don't know how people estimate this disadvantage.
> >
> > That's why I was recommending rename(). The actual window of
> > vunerability goes from perhaps hours to fractions of a second.
> >
> > In fact, if I understand this right, you could make the vulerability
> > zero by just performing the rename as one operation.
> >
> > In fact, for REINDEX cases where you don't have a lock on the entire
> > table as you do in vacuum, you could reindex the table with a simple
> > read-lock on the base table and index, and move the new index into place
> > with the users seeing no change. Only people traversing the index
> > during the change would have a problem. You just need an exclusive
> > access on the index for the duration of the rename() so no one is
> > traversing the index during the rename().
> >
> > Destroying the index and recreating opens a large time span that there
> > is no index, and you have to jury-rig something so people don't try to
> > use the index. With rename() you just put the new index in place with
> > one operation. Just don't let people traverse the index during the
> > change. The pointers to the heap tuples is the same in both indexes.
> >
> > In fact, with WAL, we will allow multiple physical files for the same
> > table by appending the table oid to the file name. In this case, the
> > old index could be deleted by rename, and people would continue to use
> > the old index until they deleted the open file pointers. Not sure how
> > this works in practice because new tuples would not be inserted into the
> > old copy of the index.
>
> Maybe I am all wrong here. Maybe most of the advantage of rename() are
> meaningless with reindex using during vacuum, which is the most
> important use of reindex.
>
> Let's look at index using during vacuum. Right now, how does vacuum
> handle indexes when it moves a tuple? Does it do each index update as
> it moves a tuple? Is that why it is so slow?
>
Yes,I believe so. It's necessary to keep consistency between heap
table and indexes even in case of abort/crash.
As far as I see,it has been a big charge for vacuum.
Regards.
Hiroshi Inoue
Inoue@tpf.co.jp
From owner-pgsql-hackers@hub.org Tue Jan 18 20:53:49 2000
Received: from hub.org (hub.org [216.126.84.1])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id VAA13285
for <pgman@candle.pha.pa.us>; Tue, 18 Jan 2000 21:53:47 -0500 (EST)
Received: from localhost (majordom@localhost)
by hub.org (8.9.3/8.9.3) with SMTP id VAA65183;
Tue, 18 Jan 2000 21:47:47 -0500 (EST)
(envelope-from owner-pgsql-hackers)
Received: by hub.org (bulk_mailer v1.5); Tue, 18 Jan 2000 21:47:33 -0500
Received: (from majordom@localhost)
by hub.org (8.9.3/8.9.3) id VAA65091
for pgsql-hackers-outgoing; Tue, 18 Jan 2000 21:46:33 -0500 (EST)
(envelope-from owner-pgsql-hackers@postgreSQL.org)
Received: from candle.pha.pa.us (pgman@s5-03.ppp.op.net [209.152.195.67])
by hub.org (8.9.3/8.9.3) with ESMTP id VAA65034
for <pgsql-hackers@postgreSQL.org>; Tue, 18 Jan 2000 21:46:12 -0500 (EST)
(envelope-from pgman@candle.pha.pa.us)
Received: (from pgman@localhost)
by candle.pha.pa.us (8.9.0/8.9.0) id VAA13040;
Tue, 18 Jan 2000 21:45:27 -0500 (EST)
From: Bruce Momjian <pgman@candle.pha.pa.us>
Message-Id: <200001190245.VAA13040@candle.pha.pa.us>
Subject: Re: [HACKERS] Index recreation in vacuum
In-Reply-To: <000801bf6224$3bfdd9a0$2801007e@tpf.co.jp> from Hiroshi Inoue at
"Jan 19, 2000 11:23:55 am"
To: Hiroshi Inoue <Inoue@tpf.co.jp>
Date: Tue, 18 Jan 2000 21:45:27 -0500 (EST)
CC: pgsql-hackers <pgsql-hackers@postgreSQL.org>
X-Mailer: ELM [version 2.4ME+ PL66 (25)]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Sender: owner-pgsql-hackers@postgreSQL.org
Status: OR
> > > In fact, for REINDEX cases where you don't have a lock on the entire
> > > table as you do in vacuum, you could reindex the table with a simple
> > > read-lock on the base table and index, and move the new index into place
> > > with the users seeing no change. Only people traversing the index
> > > during the change would have a problem. You just need an exclusive
> > > access on the index for the duration of the rename() so no one is
> > > traversing the index during the rename().
> > >
> > > Destroying the index and recreating opens a large time span that there
> > > is no index, and you have to jury-rig something so people don't try to
> > > use the index. With rename() you just put the new index in place with
> > > one operation. Just don't let people traverse the index during the
> > > change. The pointers to the heap tuples is the same in both indexes.
> > >
> > > In fact, with WAL, we will allow multiple physical files for the same
> > > table by appending the table oid to the file name. In this case, the
> > > old index could be deleted by rename, and people would continue to use
> > > the old index until they deleted the open file pointers. Not sure how
> > > this works in practice because new tuples would not be inserted into the
> > > old copy of the index.
> >
> > Maybe I am all wrong here. Maybe most of the advantage of rename() are
> > meaningless with reindex using during vacuum, which is the most
> > important use of reindex.
> >
> > Let's look at index using during vacuum. Right now, how does vacuum
> > handle indexes when it moves a tuple? Does it do each index update as
> > it moves a tuple? Is that why it is so slow?
> >
>
> Yes,I believe so. It's necessary to keep consistency between heap
> table and indexes even in case of abort/crash.
> As far as I see,it has been a big charge for vacuum.
OK, how about making a copy of the heap table before starting vacuum,
moving all the tuples in that copy, create new index, and then move the
new heap and indexes over the old version. We already have an exclusive
lock on the table. That would be 100% reliable, with the disadvantage
of using 2x the disk space. Seems like a big win.
--
Bruce Momjian | http://www.op.net/~candle
pgman@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
************
From owner-pgsql-hackers@hub.org Tue Jan 18 21:15:24 2000
Received: from hub.org (hub.org [216.126.84.1])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id WAA14115
for <pgman@candle.pha.pa.us>; Tue, 18 Jan 2000 22:15:23 -0500 (EST)
Received: from localhost (majordom@localhost)
by hub.org (8.9.3/8.9.3) with SMTP id WAA72950;
Tue, 18 Jan 2000 22:10:40 -0500 (EST)
(envelope-from owner-pgsql-hackers)
Received: by hub.org (bulk_mailer v1.5); Tue, 18 Jan 2000 22:10:32 -0500
Received: (from majordom@localhost)
by hub.org (8.9.3/8.9.3) id WAA72644
for pgsql-hackers-outgoing; Tue, 18 Jan 2000 22:09:36 -0500 (EST)
(envelope-from owner-pgsql-hackers@postgreSQL.org)
Received: from candle.pha.pa.us (pgman@s5-03.ppp.op.net [209.152.195.67])
by hub.org (8.9.3/8.9.3) with ESMTP id WAA72504
for <pgsql-hackers@postgreSQL.org>; Tue, 18 Jan 2000 22:08:40 -0500 (EST)
(envelope-from pgman@candle.pha.pa.us)
Received: (from pgman@localhost)
by candle.pha.pa.us (8.9.0/8.9.0) id WAA13965;
Tue, 18 Jan 2000 22:08:25 -0500 (EST)
From: Bruce Momjian <pgman@candle.pha.pa.us>
Message-Id: <200001190308.WAA13965@candle.pha.pa.us>
Subject: Re: [HACKERS] Index recreation in vacuum
In-Reply-To: <000f01bf622a$bf423940$2801007e@tpf.co.jp> from Hiroshi Inoue at
"Jan 19, 2000 12:10:32 pm"
To: Hiroshi Inoue <Inoue@tpf.co.jp>
Date: Tue, 18 Jan 2000 22:08:25 -0500 (EST)
CC: pgsql-hackers <pgsql-hackers@postgreSQL.org>
X-Mailer: ELM [version 2.4ME+ PL66 (25)]
MIME-Version: 1.0
Content-Type: text/plain; charset=UNKNOWN-8BIT
Content-Transfer-Encoding: 8bit
Sender: owner-pgsql-hackers@postgreSQL.org
Status: OR
> I heard from someone that old vacuum had been like so.
> Probably 2x disk space for big tables was a big disadvantage.
That's interesting.
>
> In addition,rename(),unlink(),mv aren't preferable for transaction
> control as far as I see. We couldn't avoid inconsistency using
> those OS functions.
I disagree. Vacuum can't be rolled back anyway in the sense you can
bring back expire tuples, though I have no idea why you would want to.
You have an exclusive lock on the table. Putting new heap/indexes in
place that match and have no expired tuples seems like it can not fail
in any situation.
Of course, the buffers of the old table have to be marked as invalid,
but with an exclusive lock, that is not a problem. I am sure we do that
anyway in vacuum.
> We have to wait the change of relation file naming if copying
> vacuum is needed.
> Under the spec we need not rename(),mv etc.
Sorry, I don't agree, yet...
--
Bruce Momjian | http://www.op.net/~candle
pgman@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
************
From Inoue@tpf.co.jp Tue Jan 18 21:05:23 2000
Received: from sd.tpf.co.jp (sd.tpf.co.jp [210.161.239.34])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id WAA13858
for <pgman@candle.pha.pa.us>; Tue, 18 Jan 2000 22:05:21 -0500 (EST)
Received: from cadzone ([126.0.1.40] (may be forged))
by sd.tpf.co.jp (2.5 Build 2640 (Berkeley 8.8.6)/8.8.4) with SMTP
id MAA02870; Wed, 19 Jan 2000 12:04:55 +0900
From: "Hiroshi Inoue" <Inoue@tpf.co.jp>
To: "Bruce Momjian" <pgman@candle.pha.pa.us>
Cc: "pgsql-hackers" <pgsql-hackers@postgreSQL.org>
Subject: RE: [HACKERS] Index recreation in vacuum
Date: Wed, 19 Jan 2000 12:10:32 +0900
Message-ID: <000f01bf622a$bf423940$2801007e@tpf.co.jp>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
Importance: Normal
In-Reply-To: <200001190245.VAA13040@candle.pha.pa.us>
Status: ORr
> -----Original Message-----
> From: Bruce Momjian [mailto:pgman@candle.pha.pa.us]
> > >
> > > Maybe I am all wrong here. Maybe most of the advantage of
> rename() are
> > > meaningless with reindex using during vacuum, which is the most
> > > important use of reindex.
> > >
> > > Let's look at index using during vacuum. Right now, how does vacuum
> > > handle indexes when it moves a tuple? Does it do each index update as
> > > it moves a tuple? Is that why it is so slow?
> > >
> >
> > Yes,I believe so. It's necessary to keep consistency between heap
> > table and indexes even in case of abort/crash.
> > As far as I see,it has been a big charge for vacuum.
>
> OK, how about making a copy of the heap table before starting vacuum,
> moving all the tuples in that copy, create new index, and then move the
> new heap and indexes over the old version. We already have an exclusive
> lock on the table. That would be 100% reliable, with the disadvantage
> of using 2x the disk space. Seems like a big win.
>
I heard from someone that old vacuum had been like so.
Probably 2x disk space for big tables was a big disadvantage.
In addition,rename(),unlink(),mv aren't preferable for transaction
control as far as I see. We couldn't avoid inconsistency using
those OS functions.
We have to wait the change of relation file naming if copying
vacuum is needed.
Under the spec we need not rename(),mv etc.
Regards.
Hiroshi Inoue
Inoue@tpf.co.jp
From dms@wplus.net Wed Jan 19 15:30:40 2000
Received: from relay.wplus.net (relay.wplus.net [195.131.52.179])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id QAA25919
for <pgman@candle.pha.pa.us>; Wed, 19 Jan 2000 16:30:38 -0500 (EST)
X-Real-To: pgman@candle.pha.pa.us
Received: from wplus.net (ppdms.dialup.wplus.net [195.131.52.71])
by relay.wplus.net (8.9.1/8.9.1/wplus.2) with ESMTP id AAA64218;
Thu, 20 Jan 2000 00:26:37 +0300 (MSK)
Message-ID: <38862C9D.C2151E4E@wplus.net>
Date: Thu, 20 Jan 2000 00:29:01 +0300
From: Dmitry Samersoff <dms@wplus.net>
X-Mailer: Mozilla 4.61 [en] (WinNT; I)
X-Accept-Language: ru,en
MIME-Version: 1.0
To: Hiroshi Inoue <Inoue@tpf.co.jp>
CC: Bruce Momjian <pgman@candle.pha.pa.us>,
pgsql-hackers <pgsql-hackers@postgreSQL.org>
Subject: Re: [HACKERS] Index recreation in vacuum
References: <000f01bf622a$bf423940$2801007e@tpf.co.jp>
Content-Type: text/plain; charset=koi8-r
Content-Transfer-Encoding: 7bit
Status: ORr
Hiroshi Inoue wrote:
> > > Yes,I believe so. It's necessary to keep consistency between heap
> > > table and indexes even in case of abort/crash.
> > > As far as I see,it has been a big charge for vacuum.
> >
> > OK, how about making a copy of the heap table before starting vacuum,
> > moving all the tuples in that copy, create new index, and then move the
> > new heap and indexes over the old version. We already have an exclusive
> > lock on the table. That would be 100% reliable, with the disadvantage
> > of using 2x the disk space. Seems like a big win.
> >
>
> I heard from someone that old vacuum had been like so.
> Probably 2x disk space for big tables was a big disadvantage.
Yes, It is critical.
How about sequence like this:
* Drop indices (keeping somewhere index descriptions)
* vacuuming table
* recreate indices
If something crash, user have been noticed
to re-run vacuum or recreate indices by hand
when system restarts.
I use script like described above for vacuuming
- it really increase vacuum performance for large table.
--
Dmitry Samersoff, DM\S
dms@wplus.net http://devnull.wplus.net
* there will come soft rains
From dms@wplus.net Wed Jan 19 15:42:49 2000
Received: from relay.wplus.net (relay.wplus.net [195.131.52.179])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id QAA26645
for <pgman@candle.pha.pa.us>; Wed, 19 Jan 2000 16:42:47 -0500 (EST)
X-Real-To: pgman@candle.pha.pa.us
Received: from wplus.net (ppdms.dialup.wplus.net [195.131.52.71])
by relay.wplus.net (8.9.1/8.9.1/wplus.2) with ESMTP id AAA65264;
Thu, 20 Jan 2000 00:39:02 +0300 (MSK)
Message-ID: <38862F86.20328BD3@wplus.net>
Date: Thu, 20 Jan 2000 00:41:26 +0300
From: Dmitry Samersoff <dms@wplus.net>
X-Mailer: Mozilla 4.61 [en] (WinNT; I)
X-Accept-Language: ru,en
MIME-Version: 1.0
To: Bruce Momjian <pgman@candle.pha.pa.us>
CC: Hiroshi Inoue <Inoue@tpf.co.jp>,
pgsql-hackers <pgsql-hackers@postgreSQL.org>
Subject: Re: [HACKERS] Index recreation in vacuum
References: <200001192132.QAA26048@candle.pha.pa.us>
Content-Type: text/plain; charset=koi8-r
Content-Transfer-Encoding: 7bit
Status: ORr
Bruce Momjian wrote:
>
> We need two things:
>
> auto-create index on startup
IMHO, It have to be controlled by user, because creating large index
can take a number of hours. Sometimes it's better to live without
indices
at all, and then build it by hand after workday end.
--
Dmitry Samersoff, DM\S
dms@wplus.net http://devnull.wplus.net
* there will come soft rains
From owner-pgsql-hackers@hub.org Thu Jan 20 23:51:34 2000
Received: from hub.org (hub.org [216.126.84.1])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id AAA13891
for <pgman@candle.pha.pa.us>; Fri, 21 Jan 2000 00:51:31 -0500 (EST)
Received: from localhost (majordom@localhost)
by hub.org (8.9.3/8.9.3) with SMTP id AAA91784;
Fri, 21 Jan 2000 00:47:07 -0500 (EST)
(envelope-from owner-pgsql-hackers)
Received: by hub.org (bulk_mailer v1.5); Fri, 21 Jan 2000 00:45:38 -0500
Received: (from majordom@localhost)
by hub.org (8.9.3/8.9.3) id AAA91495
for pgsql-hackers-outgoing; Fri, 21 Jan 2000 00:44:40 -0500 (EST)
(envelope-from owner-pgsql-hackers@postgreSQL.org)
Received: from candle.pha.pa.us (pgman@s5-03.ppp.op.net [209.152.195.67])
by hub.org (8.9.3/8.9.3) with ESMTP id AAA91378
for <pgsql-hackers@postgreSQL.org>; Fri, 21 Jan 2000 00:44:04 -0500 (EST)
(envelope-from pgman@candle.pha.pa.us)
Received: (from pgman@localhost)
by candle.pha.pa.us (8.9.0/8.9.0) id AAA13592;
Fri, 21 Jan 2000 00:43:49 -0500 (EST)
From: Bruce Momjian <pgman@candle.pha.pa.us>
Message-Id: <200001210543.AAA13592@candle.pha.pa.us>
Subject: [HACKERS] vacuum timings
To: Tom Lane <tgl@sss.pgh.pa.us>
Date: Fri, 21 Jan 2000 00:43:49 -0500 (EST)
CC: PostgreSQL-development <pgsql-hackers@postgreSQL.org>
X-Mailer: ELM [version 2.4ME+ PL66 (25)]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Sender: owner-pgsql-hackers@postgreSQL.org
Status: OR
I loaded 10,000,000 rows into CREATE TABLE test (x INTEGER); Table is
400MB and index is 160MB.
With index on the single in4 column, I got:
78 seconds for a vacuum
121 seconds for vacuum after deleting a single row
662 seconds for vacuum after deleting the entire table
With no index, I got:
43 seconds for a vacuum
43 seconds for vacuum after deleting a single row
43 seconds for vacuum after deleting the entire table
I find this quite interesting.
--
Bruce Momjian | http://www.op.net/~candle
pgman@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
************
From owner-pgsql-hackers@hub.org Fri Jan 21 00:34:56 2000
Received: from hub.org (hub.org [216.126.84.1])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id BAA15559
for <pgman@candle.pha.pa.us>; Fri, 21 Jan 2000 01:34:55 -0500 (EST)
Received: from localhost (majordom@localhost)
by hub.org (8.9.3/8.9.3) with SMTP id BAA06108;
Fri, 21 Jan 2000 01:32:23 -0500 (EST)
(envelope-from owner-pgsql-hackers)
Received: by hub.org (bulk_mailer v1.5); Fri, 21 Jan 2000 01:30:38 -0500
Received: (from majordom@localhost)
by hub.org (8.9.3/8.9.3) id BAA03704
for pgsql-hackers-outgoing; Fri, 21 Jan 2000 01:27:53 -0500 (EST)
(envelope-from owner-pgsql-hackers@postgreSQL.org)
Received: from sunpine.krs.ru (SunPine.krs.ru [195.161.16.37])
by hub.org (8.9.3/8.9.3) with ESMTP id BAA01710
for <pgsql-hackers@postgreSQL.org>; Fri, 21 Jan 2000 01:26:44 -0500 (EST)
(envelope-from vadim@krs.ru)
Received: from krs.ru (dune.krs.ru [195.161.16.38])
by sunpine.krs.ru (8.8.8/8.8.8) with ESMTP id NAA01685;
Fri, 21 Jan 2000 13:26:33 +0700 (KRS)
Message-ID: <3887FC19.80305217@krs.ru>
Date: Fri, 21 Jan 2000 13:26:33 +0700
From: Vadim Mikheev <vadim@krs.ru>
Organization: OJSC Rostelecom (Krasnoyarsk)
X-Mailer: Mozilla 4.5 [en] (X11; I; FreeBSD 3.0-RELEASE i386)
X-Accept-Language: ru, en
MIME-Version: 1.0
To: Bruce Momjian <pgman@candle.pha.pa.us>
CC: Tom Lane <tgl@sss.pgh.pa.us>,
PostgreSQL-development <pgsql-hackers@postgreSQL.org>
Subject: Re: [HACKERS] vacuum timings
References: <200001210543.AAA13592@candle.pha.pa.us>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Sender: owner-pgsql-hackers@postgreSQL.org
Status: OR
Bruce Momjian wrote:
>
> I loaded 10,000,000 rows into CREATE TABLE test (x INTEGER); Table is
> 400MB and index is 160MB.
>
> With index on the single in4 column, I got:
> 78 seconds for a vacuum
> 121 seconds for vacuum after deleting a single row
> 662 seconds for vacuum after deleting the entire table
>
> With no index, I got:
> 43 seconds for a vacuum
> 43 seconds for vacuum after deleting a single row
> 43 seconds for vacuum after deleting the entire table
Wi/wo -F ?
Vadim
************
From vadim@krs.ru Fri Jan 21 00:26:33 2000
Received: from sunpine.krs.ru (SunPine.krs.ru [195.161.16.37])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id BAA15239
for <pgman@candle.pha.pa.us>; Fri, 21 Jan 2000 01:26:31 -0500 (EST)
Received: from krs.ru (dune.krs.ru [195.161.16.38])
by sunpine.krs.ru (8.8.8/8.8.8) with ESMTP id NAA01685;
Fri, 21 Jan 2000 13:26:33 +0700 (KRS)
Sender: root@sunpine.krs.ru
Message-ID: <3887FC19.80305217@krs.ru>
Date: Fri, 21 Jan 2000 13:26:33 +0700
From: Vadim Mikheev <vadim@krs.ru>
Organization: OJSC Rostelecom (Krasnoyarsk)
X-Mailer: Mozilla 4.5 [en] (X11; I; FreeBSD 3.0-RELEASE i386)
X-Accept-Language: ru, en
MIME-Version: 1.0
To: Bruce Momjian <pgman@candle.pha.pa.us>
CC: Tom Lane <tgl@sss.pgh.pa.us>,
PostgreSQL-development <pgsql-hackers@postgreSQL.org>
Subject: Re: [HACKERS] vacuum timings
References: <200001210543.AAA13592@candle.pha.pa.us>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Status: ORr
Bruce Momjian wrote:
>
> I loaded 10,000,000 rows into CREATE TABLE test (x INTEGER); Table is
> 400MB and index is 160MB.
>
> With index on the single in4 column, I got:
> 78 seconds for a vacuum
> 121 seconds for vacuum after deleting a single row
> 662 seconds for vacuum after deleting the entire table
>
> With no index, I got:
> 43 seconds for a vacuum
> 43 seconds for vacuum after deleting a single row
> 43 seconds for vacuum after deleting the entire table
Wi/wo -F ?
Vadim
From Inoue@tpf.co.jp Fri Jan 21 00:40:35 2000
Received: from sd.tpf.co.jp (sd.tpf.co.jp [210.161.239.34])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id BAA15684
for <pgman@candle.pha.pa.us>; Fri, 21 Jan 2000 01:40:33 -0500 (EST)
Received: from cadzone ([126.0.1.40] (may be forged))
by sd.tpf.co.jp (2.5 Build 2640 (Berkeley 8.8.6)/8.8.4) with SMTP
id PAA04316; Fri, 21 Jan 2000 15:40:35 +0900
From: "Hiroshi Inoue" <Inoue@tpf.co.jp>
To: "Bruce Momjian" <pgman@candle.pha.pa.us>
Cc: "PostgreSQL-development" <pgsql-hackers@postgreSQL.org>,
"Tom Lane" <tgl@sss.pgh.pa.us>
Subject: RE: [HACKERS] vacuum timings
Date: Fri, 21 Jan 2000 15:46:15 +0900
Message-ID: <000201bf63db$36cdae20$2801007e@tpf.co.jp>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
In-Reply-To: <200001210543.AAA13592@candle.pha.pa.us>
Status: OR
> -----Original Message-----
> From: owner-pgsql-hackers@postgreSQL.org
> [mailto:owner-pgsql-hackers@postgreSQL.org]On Behalf Of Bruce Momjian
>
> I loaded 10,000,000 rows into CREATE TABLE test (x INTEGER); Table is
> 400MB and index is 160MB.
>
> With index on the single in4 column, I got:
> 78 seconds for a vacuum
vc_vaconeind() is called once
> 121 seconds for vacuum after deleting a single row
vc_vaconeind() is called twice
Hmmm,vc_vaconeind() takes pretty long time even if it does little.
> 662 seconds for vacuum after deleting the entire table
>
How about half of the rows deleted case ?
It would take longer time.
Regards.
Hiroshi Inoue
Inoue@tpf.co.jp
From owner-pgsql-hackers@hub.org Fri Jan 21 12:00:49 2000
Received: from hub.org (hub.org [216.126.84.1])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id NAA13329
for <pgman@candle.pha.pa.us>; Fri, 21 Jan 2000 13:00:47 -0500 (EST)
Received: from localhost (majordom@localhost)
by hub.org (8.9.3/8.9.3) with SMTP id MAA96106;
Fri, 21 Jan 2000 12:55:34 -0500 (EST)
(envelope-from owner-pgsql-hackers)
Received: by hub.org (bulk_mailer v1.5); Fri, 21 Jan 2000 12:53:53 -0500
Received: (from majordom@localhost)
by hub.org (8.9.3/8.9.3) id MAA95775
for pgsql-hackers-outgoing; Fri, 21 Jan 2000 12:52:54 -0500 (EST)
(envelope-from owner-pgsql-hackers@postgreSQL.org)
Received: from candle.pha.pa.us (root@s5-03.ppp.op.net [209.152.195.67])
by hub.org (8.9.3/8.9.3) with ESMTP id MAA95720
for <pgsql-hackers@postgreSQL.org>; Fri, 21 Jan 2000 12:52:39 -0500 (EST)
(envelope-from pgman@candle.pha.pa.us)
Received: (from pgman@localhost)
by candle.pha.pa.us (8.9.0/8.9.0) id MAA12106;
Fri, 21 Jan 2000 12:51:53 -0500 (EST)
From: Bruce Momjian <pgman@candle.pha.pa.us>
Message-Id: <200001211751.MAA12106@candle.pha.pa.us>
Subject: [HACKERS] Re: vacuum timings
In-Reply-To: <3641.948433911@sss.pgh.pa.us> from Tom Lane at "Jan 21, 2000 00:51:51
am"
To: Tom Lane <tgl@sss.pgh.pa.us>
Date: Fri, 21 Jan 2000 12:51:53 -0500 (EST)
CC: PostgreSQL-development <pgsql-hackers@postgreSQL.org>
X-Mailer: ELM [version 2.4ME+ PL66 (25)]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Sender: owner-pgsql-hackers@postgreSQL.org
Status: OR
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > I loaded 10,000,000 rows into CREATE TABLE test (x INTEGER); Table is
> > 400MB and index is 160MB.
>
> > With index on the single in4 column, I got:
> > 78 seconds for a vacuum
> > 121 seconds for vacuum after deleting a single row
> > 662 seconds for vacuum after deleting the entire table
>
> > With no index, I got:
> > 43 seconds for a vacuum
> > 43 seconds for vacuum after deleting a single row
> > 43 seconds for vacuum after deleting the entire table
>
> > I find this quite interesting.
>
> How long does it take to create the index on your setup --- ie,
> if vacuum did a drop/create index, would it be competitive?
OK, new timings with -F enabled:
index no index
519 same load
247 " first vacuum
40 " other vacuums
1222 X index creation
90 X first vacuum
80 X other vacuums
<1 90 delete one row
121 38 vacuum after delete 1 row
346 344 delete all rows
440 44 first vacuum
20 <1 other vacuums(index is still same size)
Conclusions:
o indexes never get smaller
o drop/recreate index is slower than vacuum of indexes
What other conclusions can be made?
--
Bruce Momjian | http://www.op.net/~candle
pgman@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
************
From scrappy@hub.org Fri Jan 21 12:45:38 2000
Received: from thelab.hub.org (nat200.60.mpoweredpc.net [142.177.200.60])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id NAA14380
for <pgman@candle.pha.pa.us>; Fri, 21 Jan 2000 13:45:29 -0500 (EST)
Received: from localhost (scrappy@localhost)
by thelab.hub.org (8.9.3/8.9.1) with ESMTP id OAA68289;
Fri, 21 Jan 2000 14:45:35 -0400 (AST)
(envelope-from scrappy@hub.org)
X-Authentication-Warning: thelab.hub.org: scrappy owned process doing -bs
Date: Fri, 21 Jan 2000 14:45:34 -0400 (AST)
From: The Hermit Hacker <scrappy@hub.org>
To: Bruce Momjian <pgman@candle.pha.pa.us>
cc: Tom Lane <tgl@sss.pgh.pa.us>,
PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: [HACKERS] Re: vacuum timings
In-Reply-To: <200001211751.MAA12106@candle.pha.pa.us>
Message-ID: <Pine.BSF.4.21.0001211443480.23487-100000@thelab.hub.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Status: OR
On Fri, 21 Jan 2000, Bruce Momjian wrote:
> OK, new timings with -F enabled:
>
> index no index
> 519 same load
> 247 " first vacuum
> 40 " other vacuums
>
> 1222 X index creation
> 90 X first vacuum
> 80 X other vacuums
>
> <1 90 delete one row
> 121 38 vacuum after delete 1 row
>
> 346 344 delete all rows
> 440 44 first vacuum
> 20 <1 other vacuums(index is still same size)
>
> Conclusions:
>
> o indexes never get smaller
this one, I thought, was a known? if I remember right, Vadim changed it
so that space was reused, but index never shrunk in size ... no?
Marc G. Fournier ICQ#7615664 IRC Nick: Scrappy
Systems Administrator @ hub.org
primary: scrappy@hub.org secondary: scrappy@{freebsd|postgresql}.org
From tgl@sss.pgh.pa.us Fri Jan 21 13:06:35 2000
Received: from sss2.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id OAA14618
for <pgman@candle.pha.pa.us>; Fri, 21 Jan 2000 14:06:33 -0500 (EST)
Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1])
by sss2.sss.pgh.pa.us (8.9.3/8.9.3) with ESMTP id OAA16501;
Fri, 21 Jan 2000 14:06:31 -0500 (EST)
To: Bruce Momjian <pgman@candle.pha.pa.us>
cc: PostgreSQL-development <pgsql-hackers@postgreSQL.org>
Subject: Re: vacuum timings
In-reply-to: <200001211751.MAA12106@candle.pha.pa.us>
References: <200001211751.MAA12106@candle.pha.pa.us>
Comments: In-reply-to Bruce Momjian <pgman@candle.pha.pa.us>
message dated "Fri, 21 Jan 2000 12:51:53 -0500"
Date: Fri, 21 Jan 2000 14:06:31 -0500
Message-ID: <16498.948481591@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
Status: OR
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Conclusions:
> o indexes never get smaller
Which we knew...
> o drop/recreate index is slower than vacuum of indexes
Quite a few people have reported finding the opposite in practice.
You should probably try vacuuming after deleting or updating some
fraction of the rows, rather than just the all or none cases.
regards, tom lane
From dms@wplus.net Fri Jan 21 13:51:27 2000
Received: from relay.wplus.net (relay.wplus.net [195.131.52.179])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id OAA15623
for <pgman@candle.pha.pa.us>; Fri, 21 Jan 2000 14:51:24 -0500 (EST)
X-Real-To: pgman@candle.pha.pa.us
Received: from wplus.net (ppdms.dialup.wplus.net [195.131.52.71])
by relay.wplus.net (8.9.1/8.9.1/wplus.2) with ESMTP id WAA89451;
Fri, 21 Jan 2000 22:46:19 +0300 (MSK)
Message-ID: <3888B822.28F79A1F@wplus.net>
Date: Fri, 21 Jan 2000 22:48:50 +0300
From: Dmitry Samersoff <dms@wplus.net>
X-Mailer: Mozilla 4.7 [en] (WinNT; I)
X-Accept-Language: ru,en
MIME-Version: 1.0
To: Tom Lane <tgl@sss.pgh.pa.us>
CC: Bruce Momjian <pgman@candle.pha.pa.us>,
PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: [HACKERS] Re: vacuum timings
References: <200001211751.MAA12106@candle.pha.pa.us> <16498.948481591@sss.pgh.pa.us>
Content-Type: text/plain; charset=koi8-r
Content-Transfer-Encoding: 7bit
Status: ORr
Tom Lane wrote:
>
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > Conclusions:
> > o indexes never get smaller
>
> Which we knew...
>
> > o drop/recreate index is slower than vacuum of indexes
>
> Quite a few people have reported finding the opposite in practice.
I'm one of them. On 1,5 GB table with three indices it about twice
slowly.
Probably becouse vacuuming indices brakes system cache policy.
(FreeBSD 3.3)
--
Dmitry Samersoff, DM\S
dms@wplus.net http://devnull.wplus.net
* there will come soft rains
From owner-pgsql-hackers@hub.org Fri Jan 21 14:04:08 2000
Received: from hub.org (hub.org [216.126.84.1])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id PAA16140
for <pgman@candle.pha.pa.us>; Fri, 21 Jan 2000 15:04:06 -0500 (EST)
Received: from localhost (majordom@localhost)
by hub.org (8.9.3/8.9.3) with SMTP id OAA34808;
Fri, 21 Jan 2000 14:59:30 -0500 (EST)
(envelope-from owner-pgsql-hackers)
Received: by hub.org (bulk_mailer v1.5); Fri, 21 Jan 2000 14:57:48 -0500
Received: (from majordom@localhost)
by hub.org (8.9.3/8.9.3) id OAA34320
for pgsql-hackers-outgoing; Fri, 21 Jan 2000 14:56:50 -0500 (EST)
(envelope-from owner-pgsql-hackers@postgreSQL.org)
Received: from candle.pha.pa.us (pgman@s5-03.ppp.op.net [209.152.195.67])
by hub.org (8.9.3/8.9.3) with ESMTP id OAA34255
for <pgsql-hackers@postgresql.org>; Fri, 21 Jan 2000 14:56:18 -0500 (EST)
(envelope-from pgman@candle.pha.pa.us)
Received: (from pgman@localhost)
by candle.pha.pa.us (8.9.0/8.9.0) id OAA15772;
Fri, 21 Jan 2000 14:54:22 -0500 (EST)
From: Bruce Momjian <pgman@candle.pha.pa.us>
Message-Id: <200001211954.OAA15772@candle.pha.pa.us>
Subject: Re: [HACKERS] Re: vacuum timings
In-Reply-To: <3888B822.28F79A1F@wplus.net> from Dmitry Samersoff at "Jan 21,
2000 10:48:50 pm"
To: Dmitry Samersoff <dms@wplus.net>
Date: Fri, 21 Jan 2000 14:54:21 -0500 (EST)
CC: Tom Lane <tgl@sss.pgh.pa.us>,
PostgreSQL-development <pgsql-hackers@postgreSQL.org>
X-Mailer: ELM [version 2.4ME+ PL66 (25)]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Sender: owner-pgsql-hackers@postgreSQL.org
Status: OR
[Charset koi8-r unsupported, filtering to ASCII...]
> Tom Lane wrote:
> >
> > Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > > Conclusions:
> > > o indexes never get smaller
> >
> > Which we knew...
> >
> > > o drop/recreate index is slower than vacuum of indexes
> >
> > Quite a few people have reported finding the opposite in practice.
>
> I'm one of them. On 1,5 GB table with three indices it about twice
> slowly.
> Probably becouse vacuuming indices brakes system cache policy.
> (FreeBSD 3.3)
OK, we are researching what things can be done to improve this. We are
toying with:
lock table for less duration, or read lock
creating another copy of heap/indexes, and rename() over old files
improving heap vacuum speed
improving index vacuum speed
moving analyze out of vacuum
--
Bruce Momjian | http://www.op.net/~candle
pgman@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
************
From scrappy@hub.org Fri Jan 21 14:12:16 2000
Received: from thelab.hub.org (nat200.60.mpoweredpc.net [142.177.200.60])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id PAA16521
for <pgman@candle.pha.pa.us>; Fri, 21 Jan 2000 15:12:13 -0500 (EST)
Received: from localhost (scrappy@localhost)
by thelab.hub.org (8.9.3/8.9.1) with ESMTP id QAA69039;
Fri, 21 Jan 2000 16:12:25 -0400 (AST)
(envelope-from scrappy@hub.org)
X-Authentication-Warning: thelab.hub.org: scrappy owned process doing -bs
Date: Fri, 21 Jan 2000 16:12:25 -0400 (AST)
From: The Hermit Hacker <scrappy@hub.org>
To: Bruce Momjian <pgman@candle.pha.pa.us>
cc: Dmitry Samersoff <dms@wplus.net>, Tom Lane <tgl@sss.pgh.pa.us>,
PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: [HACKERS] Re: vacuum timings
In-Reply-To: <200001211954.OAA15772@candle.pha.pa.us>
Message-ID: <Pine.BSF.4.21.0001211607080.23487-100000@thelab.hub.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Status: OR
On Fri, 21 Jan 2000, Bruce Momjian wrote:
> [Charset koi8-r unsupported, filtering to ASCII...]
> > Tom Lane wrote:
> > >
> > > Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > > > Conclusions:
> > > > o indexes never get smaller
> > >
> > > Which we knew...
> > >
> > > > o drop/recreate index is slower than vacuum of indexes
> > >
> > > Quite a few people have reported finding the opposite in practice.
> >
> > I'm one of them. On 1,5 GB table with three indices it about twice
> > slowly.
> > Probably becouse vacuuming indices brakes system cache policy.
> > (FreeBSD 3.3)
>
> OK, we are researching what things can be done to improve this. We are
> toying with:
>
> lock table for less duration, or read lock
if there is some way that we can work around the bug that I believe Tom
found with removing the lock altogether (ie. makig use of MVCC), I think
that would be the best option ... if not possible, at least get things
down to a table lock vs the whole database?
a good example is the udmsearch that we are using on the site ... it uses
multiple tables to store the dictionary, each representing words of X size
... if I'm searching on a 4 letter word, and the whole database is locked
while it is working on the dictionary with 8 letter words, I'm sitting
there idle ... at least if we only locked the 8 letter table, everyone not
doing 8 letter searches can go on their merry way ...
Slightly longer vacuum's, IMHO, are acceptable if, to the end users, its
as transparent as possible ... locking per table would be slightly slower,
I think, because once a table is finished, the next table would need to
have an exclusive lock put on it before starting, so you'd have to
possibly wait for that...?
> creating another copy of heap/indexes, and rename() over old files
sounds to me like introducing a large potential for error here ...
> moving analyze out of vacuum
I think that should be done anyway ... if we ever get to the point that
we're able to re-use rows in tables, then that would eliminate the
immediate requirement for vacuum, but still retain a requirement for a
periodic analyze ... no?
Marc G. Fournier ICQ#7615664 IRC Nick: Scrappy
Systems Administrator @ hub.org
primary: scrappy@hub.org secondary: scrappy@{freebsd|postgresql}.org
From tgl@sss.pgh.pa.us Fri Jan 21 16:02:07 2000
Received: from sss2.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id RAA20290
for <pgman@candle.pha.pa.us>; Fri, 21 Jan 2000 17:02:06 -0500 (EST)
Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1])
by sss2.sss.pgh.pa.us (8.9.3/8.9.3) with ESMTP id RAA09697;
Fri, 21 Jan 2000 17:02:06 -0500 (EST)
To: The Hermit Hacker <scrappy@hub.org>
cc: Bruce Momjian <pgman@candle.pha.pa.us>,
PostgreSQL-development <pgsql-hackers@postgreSQL.org>
Subject: Re: [HACKERS] Re: vacuum timings
In-reply-to: <Pine.BSF.4.21.0001211607080.23487-100000@thelab.hub.org>
References: <Pine.BSF.4.21.0001211607080.23487-100000@thelab.hub.org>
Comments: In-reply-to The Hermit Hacker <scrappy@hub.org>
message dated "Fri, 21 Jan 2000 16:12:25 -0400"
Date: Fri, 21 Jan 2000 17:02:06 -0500
Message-ID: <9694.948492126@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
Status: OR
The Hermit Hacker <scrappy@hub.org> writes:
>> lock table for less duration, or read lock
> if there is some way that we can work around the bug that I believe Tom
> found with removing the lock altogether (ie. makig use of MVCC), I think
> that would be the best option ... if not possible, at least get things
> down to a table lock vs the whole database?
Huh? VACUUM only requires an exclusive lock on the table it is
currently vacuuming; there's no database-wide lock.
Even a single-table exclusive lock is bad, of course, if it's a large
table that's critical to a 24x7 application. Bruce was talking about
the possibility of having VACUUM get just a write lock on the table;
other backends could still read it, but not write it, during the vacuum
process. That'd be a considerable step forward for 24x7 applications,
I think.
It looks like that could be done if we rewrote the table as a new file
(instead of compacting-in-place), but there's a problem when it comes
time to rename the new files into place. At that point you'd need to
get an exclusive lock to ensure all the readers are out of the table too
--- and upgrading from a plain lock to an exclusive lock is a well-known
recipe for deadlocks. Not sure if this can be solved.
regards, tom lane
From tgl@sss.pgh.pa.us Fri Jan 21 22:50:34 2000
Received: from sss2.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id XAA01657
for <pgman@candle.pha.pa.us>; Fri, 21 Jan 2000 23:50:28 -0500 (EST)
Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1])
by sss2.sss.pgh.pa.us (8.9.3/8.9.3) with ESMTP id XAA19681;
Fri, 21 Jan 2000 23:50:13 -0500 (EST)
To: Bruce Momjian <pgman@candle.pha.pa.us>
cc: PostgreSQL-development <pgsql-hackers@postgreSQL.org>
Subject: Re: vacuum timings
In-reply-to: <200001211751.MAA12106@candle.pha.pa.us>
References: <200001211751.MAA12106@candle.pha.pa.us>
Comments: In-reply-to Bruce Momjian <pgman@candle.pha.pa.us>
message dated "Fri, 21 Jan 2000 12:51:53 -0500"
Date: Fri, 21 Jan 2000 23:50:13 -0500
Message-ID: <19678.948516613@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
Status: ORr
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Conclusions:
> o drop/recreate index is slower than vacuum of indexes
BTW, I did some profiling of CREATE INDEX this evening (quite
unintentionally actually; I was interested in COPY IN, but the pg_dump
script I used as driver happened to create some indexes too). I was
startled to discover that 60% of the runtime of CREATE INDEX is spent in
_bt_invokestrat (which is called from tuplesort.c's comparetup_index,
and exists only to figure out which specific comparison routine to call).
Of this, a whopping 4% was spent in the useful subroutine, int4gt. All
the rest went into lookup and validation checks that by rights should be
done once per index creation, not once per comparison.
In short: a fairly straightforward bit of optimization will eliminate
circa 50% of the CPU time consumed by CREATE INDEX. All we need is to
figure out where to cache the lookup results. The optimization would
improve insertions and lookups in indexes, as well, if we can cache
the lookup results in those scenarios.
This was for a table small enough that tuplesort.c could do the sort
entirely in memory, so I'm sure the gains would be smaller for a large
table that requires a disk-based sort. Still, it seems worth looking
into...
regards, tom lane
From owner-pgsql-hackers@hub.org Sat Jan 22 02:31:03 2000
Received: from renoir.op.net (root@renoir.op.net [207.29.195.4])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id DAA06743
for <pgman@candle.pha.pa.us>; Sat, 22 Jan 2000 03:31:02 -0500 (EST)
Received: from hub.org (hub.org [216.126.84.1]) by renoir.op.net (o1/$Revision: 1.5 $) with ESMTP id DAA07529 for <pgman@candle.pha.pa.us>; Sat, 22 Jan 2000 03:25:13 -0500 (EST)
Received: from localhost (majordom@localhost)
by hub.org (8.9.3/8.9.3) with SMTP id DAA31900;
Sat, 22 Jan 2000 03:19:53 -0500 (EST)
(envelope-from owner-pgsql-hackers)
Received: by hub.org (bulk_mailer v1.5); Sat, 22 Jan 2000 03:17:56 -0500
Received: (from majordom@localhost)
by hub.org (8.9.3/8.9.3) id DAA31715
for pgsql-hackers-outgoing; Sat, 22 Jan 2000 03:16:58 -0500 (EST)
(envelope-from owner-pgsql-hackers@postgreSQL.org)
Received: from sd.tpf.co.jp (sd.tpf.co.jp [210.161.239.34])
by hub.org (8.9.3/8.9.3) with ESMTP id DAA31647
for <pgsql-hackers@postgresql.org>; Sat, 22 Jan 2000 03:16:26 -0500 (EST)
(envelope-from Inoue@tpf.co.jp)
Received: from mcadnote1 (ppm114.noc.fukui.nsk.ne.jp [210.161.188.33])
by sd.tpf.co.jp (2.5 Build 2640 (Berkeley 8.8.6)/8.8.4) with SMTP
id RAA04754; Sat, 22 Jan 2000 17:14:43 +0900
From: "Hiroshi Inoue" <Inoue@tpf.co.jp>
To: "Tom Lane" <tgl@sss.pgh.pa.us>, "Bruce Momjian" <pgman@candle.pha.pa.us>
Cc: "PostgreSQL-development" <pgsql-hackers@postgresql.org>
Subject: RE: [HACKERS] Re: vacuum timings
Date: Sat, 22 Jan 2000 17:15:37 +0900
Message-ID: <NDBBIJLOILGIKBGDINDFIEEACCAA.Inoue@tpf.co.jp>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-2022-jp"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
In-Reply-To: <16498.948481591@sss.pgh.pa.us>
Importance: Normal
Sender: owner-pgsql-hackers@postgresql.org
Status: OR
> -----Original Message-----
> From: owner-pgsql-hackers@postgresql.org
> [mailto:owner-pgsql-hackers@postgresql.org]On Behalf Of Tom Lane
>
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > Conclusions:
> > o indexes never get smaller
>
> Which we knew...
>
> > o drop/recreate index is slower than vacuum of indexes
>
> Quite a few people have reported finding the opposite in practice.
> You should probably try vacuuming after deleting or updating some
> fraction of the rows, rather than just the all or none cases.
>
Vacuum after delelting all rows isn't a worst case.
There's no moving in that case and vacuum doesn't need to call
index_insert() corresponding to the moving of heap tuples.
Vacuum after deleting half of rows may be one of the worst case.
In this case,index_delete() is called as many times as 'delete all'
case and expensive index_insert() is called for moved_in tuples.
Regards.
Hiroshi Inoue
Inoue@tpf.co.jp
************
From tgl@sss.pgh.pa.us Sat Jan 22 10:31:02 2000
Received: from renoir.op.net (root@renoir.op.net [207.29.195.4])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id LAA20882
for <pgman@candle.pha.pa.us>; Sat, 22 Jan 2000 11:31:00 -0500 (EST)
Received: from sss2.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2]) by renoir.op.net (o1/$Revision: 1.5 $) with ESMTP id LAA26612 for <pgman@candle.pha.pa.us>; Sat, 22 Jan 2000 11:12:44 -0500 (EST)
Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1])
by sss2.sss.pgh.pa.us (8.9.3/8.9.3) with ESMTP id LAA20569;
Sat, 22 Jan 2000 11:11:26 -0500 (EST)
To: "Hiroshi Inoue" <Inoue@tpf.co.jp>
cc: "Bruce Momjian" <pgman@candle.pha.pa.us>,
"PostgreSQL-development" <pgsql-hackers@postgreSQL.org>
Subject: Re: [HACKERS] Re: vacuum timings
In-reply-to: <NDBBIJLOILGIKBGDINDFIEEACCAA.Inoue@tpf.co.jp>
References: <NDBBIJLOILGIKBGDINDFIEEACCAA.Inoue@tpf.co.jp>
Comments: In-reply-to "Hiroshi Inoue" <Inoue@tpf.co.jp>
message dated "Sat, 22 Jan 2000 17:15:37 +0900"
Date: Sat, 22 Jan 2000 11:11:25 -0500
Message-ID: <20566.948557485@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
Status: OR
"Hiroshi Inoue" <Inoue@tpf.co.jp> writes:
> Vacuum after deleting half of rows may be one of the worst case.
Or equivalently, vacuum after updating all the rows.
regards, tom lane
From tgl@sss.pgh.pa.us Thu Jan 20 23:51:49 2000
Received: from sss2.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id AAA13919
for <pgman@candle.pha.pa.us>; Fri, 21 Jan 2000 00:51:47 -0500 (EST)
Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1])
by sss2.sss.pgh.pa.us (8.9.3/8.9.3) with ESMTP id AAA03644;
Fri, 21 Jan 2000 00:51:51 -0500 (EST)
To: Bruce Momjian <pgman@candle.pha.pa.us>
cc: PostgreSQL-development <pgsql-hackers@postgreSQL.org>
Subject: Re: vacuum timings
In-reply-to: <200001210543.AAA13592@candle.pha.pa.us>
References: <200001210543.AAA13592@candle.pha.pa.us>
Comments: In-reply-to Bruce Momjian <pgman@candle.pha.pa.us>
message dated "Fri, 21 Jan 2000 00:43:49 -0500"
Date: Fri, 21 Jan 2000 00:51:51 -0500
Message-ID: <3641.948433911@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
Status: ORr
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> I loaded 10,000,000 rows into CREATE TABLE test (x INTEGER); Table is
> 400MB and index is 160MB.
> With index on the single in4 column, I got:
> 78 seconds for a vacuum
> 121 seconds for vacuum after deleting a single row
> 662 seconds for vacuum after deleting the entire table
> With no index, I got:
> 43 seconds for a vacuum
> 43 seconds for vacuum after deleting a single row
> 43 seconds for vacuum after deleting the entire table
> I find this quite interesting.
How long does it take to create the index on your setup --- ie,
if vacuum did a drop/create index, would it be competitive?
regards, tom lane
From pgsql-hackers-owner+M5909@hub.org Thu Aug 17 20:15:33 2000
Received: from hub.org (root@hub.org [216.126.84.1])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id UAA00644
for <pgman@candle.pha.pa.us>; Thu, 17 Aug 2000 20:15:32 -0400 (EDT)
Received: from hub.org (majordom@localhost [127.0.0.1])
by hub.org (8.10.1/8.10.1) with SMTP id e7I0APm69660;
Thu, 17 Aug 2000 20:10:25 -0400 (EDT)
Received: from fw.wintelcom.net (bright@ns1.wintelcom.net [209.1.153.20])
by hub.org (8.10.1/8.10.1) with ESMTP id e7I01Jm68072
for <pgsql-hackers@postgresql.org>; Thu, 17 Aug 2000 20:01:19 -0400 (EDT)
Received: (from bright@localhost)
by fw.wintelcom.net (8.10.0/8.10.0) id e7I01IA20820
for pgsql-hackers@postgresql.org; Thu, 17 Aug 2000 17:01:18 -0700 (PDT)
Date: Thu, 17 Aug 2000 17:01:18 -0700
From: Alfred Perlstein <bright@wintelcom.net>
To: pgsql-hackers@postgresql.org
Subject: [HACKERS] VACUUM optimization ideas.
Message-ID: <20000817170118.K4854@fw.wintelcom.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.2.4i
X-Mailing-List: pgsql-hackers@postgresql.org
Precedence: bulk
Sender: pgsql-hackers-owner@hub.org
Status: ORr
Here's two ideas I had for optimizing vacuum, I apologize in advance
if the ideas presented here are niave and don't take into account
the actual code that makes up postgresql.
================
#1
Reducing the time vacuum must hold an exlusive lock on a table:
The idea is that since rows are marked deleted it's ok for the
vacuum to fill them with data from the tail of the table as
long as no transaction is in progress that has started before
the row was deleted.
This may allow the vacuum process to copyback all the data without
a lock, when all the copying is done it then aquires an exlusive lock
and does this:
Aquire an exclusive lock.
Walk all the deleted data marking it as current.
Truncate the table.
Release the lock.
Since the data is still marked invalid (right?) even if valid data
is copied into the space it should be ignored as long as there's no
transaction occurring that started before the data was invalidated.
================
#2
Reducing the amount of scanning a vaccum must do:
It would make sense that if a value of the earliest deleted chunk
was kept in a table then vacuum would not have to scan the entire
table in order to work, it would only need to start at the 'earliest'
invalidated row.
The utility of this (at least for us) is that we have several tables
that will grow to hundreds of megabytes, however changes will only
happen at the tail end (recently added rows). If we could reduce the
amount of time spent in a vacuum state it would help us a lot.
================
I'm wondering if these ideas make sense and may help at all.
thanks,
--
-Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org]
From pgsql-hackers-owner+M5912@hub.org Fri Aug 18 01:36:14 2000
Received: from hub.org (root@hub.org [216.126.84.1])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id BAA07787
for <pgman@candle.pha.pa.us>; Fri, 18 Aug 2000 01:36:12 -0400 (EDT)
Received: from hub.org (majordom@localhost [127.0.0.1])
by hub.org (8.10.1/8.10.1) with SMTP id e7I5Q2m38759;
Fri, 18 Aug 2000 01:26:04 -0400 (EDT)
Received: from courier02.adinet.com.uy (courier02.adinet.com.uy [206.99.44.245])
by hub.org (8.10.1/8.10.1) with ESMTP id e7I5Bam35785
for <pgsql-hackers@postgresql.org>; Fri, 18 Aug 2000 01:11:37 -0400 (EDT)
Received: from adinet.com.uy (haroldo@r207-50-240-116.adinet.com.uy [207.50.240.116])
by courier02.adinet.com.uy (8.9.3/8.9.3) with ESMTP id CAA17259;
Fri, 18 Aug 2000 02:10:49 -0300 (GMT)
Message-ID: <399CC739.B9B13D18@adinet.com.uy>
Date: Fri, 18 Aug 2000 02:18:49 -0300
From: hstenger@adinet.com.uy
Reply-To: hstenger@ieee.org
Organization: PRISMA, Servicio y Desarrollo
X-Mailer: Mozilla 4.72 [en] (X11; I; Linux 2.2.14 i586)
X-Accept-Language: en
MIME-Version: 1.0
To: Alfred Perlstein <bright@wintelcom.net>, pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] VACUUM optimization ideas.
References: <20000817170118.K4854@fw.wintelcom.net>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailing-List: pgsql-hackers@postgresql.org
Precedence: bulk
Sender: pgsql-hackers-owner@hub.org
Status: ORr
Alfred Perlstein wrote:
> #1
>
> Reducing the time vacuum must hold an exlusive lock on a table:
>
> The idea is that since rows are marked deleted it's ok for the
> vacuum to fill them with data from the tail of the table as
> long as no transaction is in progress that has started before
> the row was deleted.
>
> This may allow the vacuum process to copyback all the data without
> a lock, when all the copying is done it then aquires an exlusive lock
> and does this:
>
> Aquire an exclusive lock.
> Walk all the deleted data marking it as current.
> Truncate the table.
> Release the lock.
>
> Since the data is still marked invalid (right?) even if valid data
> is copied into the space it should be ignored as long as there's no
> transaction occurring that started before the data was invalidated.
Yes, but nothing prevents newer transactions from modifying the _origin_ side of
the copied data _after_ it was copied, but before the Lock-Walk-Truncate-Unlock
cycle takes place, and so it seems unsafe. Maybe locking each record before
copying it up ...
Regards,
Haroldo.
--
----------------------+------------------------
Haroldo Stenger | hstenger@ieee.org
Montevideo, Uruguay. | hstenger@adinet.com.uy
----------------------+------------------------
Visit UYLUG Web Site: http://www.linux.org.uy
-----------------------------------------------
From pgsql-hackers-owner+M5917@hub.org Fri Aug 18 09:41:33 2000
Received: from hub.org (root@hub.org [216.126.84.1])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id JAA05170
for <pgman@candle.pha.pa.us>; Fri, 18 Aug 2000 09:41:33 -0400 (EDT)
Received: from hub.org (majordom@localhost [127.0.0.1])
by hub.org (8.10.1/8.10.1) with SMTP id e7IDVjm75143;
Fri, 18 Aug 2000 09:31:46 -0400 (EDT)
Received: from andie.ip23.net (andie.ip23.net [212.83.32.23])
by hub.org (8.10.1/8.10.1) with ESMTP id e7IDPIm73296
for <pgsql-hackers@postgresql.org>; Fri, 18 Aug 2000 09:25:18 -0400 (EDT)
Received: from imap1.ip23.net (imap1.ip23.net [212.83.32.35])
by andie.ip23.net (8.9.3/8.9.3) with ESMTP id PAA58387;
Fri, 18 Aug 2000 15:25:12 +0200 (CEST)
Received: from ip23.net (spc.ip23.net [212.83.32.122])
by imap1.ip23.net (8.9.3/8.9.3) with ESMTP id PAA59177;
Fri, 18 Aug 2000 15:41:28 +0200 (CEST)
Message-ID: <399D3938.582FDB49@ip23.net>
Date: Fri, 18 Aug 2000 15:25:12 +0200
From: Sevo Stille <sevo@ip23.net>
Organization: IP23
X-Mailer: Mozilla 4.61 [en] (X11; I; Linux 2.2.10 i686)
X-Accept-Language: en, de
MIME-Version: 1.0
To: Alfred Perlstein <bright@wintelcom.net>
CC: pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] VACUUM optimization ideas.
References: <20000817170118.K4854@fw.wintelcom.net>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailing-List: pgsql-hackers@postgresql.org
Precedence: bulk
Sender: pgsql-hackers-owner@hub.org
Status: OR
Alfred Perlstein wrote:
> The idea is that since rows are marked deleted it's ok for the
> vacuum to fill them with data from the tail of the table as
> long as no transaction is in progress that has started before
> the row was deleted.
Well, isn't one of the advantages of vacuuming in the reordering it
does? With a "fill deleted chunks" logic, we'd have far less order in
the databases.
> This may allow the vacuum process to copyback all the data without
> a lock,
Nope. Another process might update the values in between move and mark,
if the record is not locked. We'd either have to write-lock the entire
table for that period, write lock every item as it is moved, or lock,
move and mark on a per-record base. The latter would be slow, but it
could be done in a permanent low priority background process, utilizing
empty CPU cycles. Besides, it probably could not only be done simply
filling from the tail, but also moving up the records in a sorted
fashion.
> #2
>
> Reducing the amount of scanning a vaccum must do:
>
> It would make sense that if a value of the earliest deleted chunk
> was kept in a table then vacuum would not have to scan the entire
> table in order to work, it would only need to start at the 'earliest'
> invalidated row.
Trivial to do. But of course #1 may imply that the physical ordering is
even less likely to be related to the logical ordering in a way where
this helps.
> The utility of this (at least for us) is that we have several tables
> that will grow to hundreds of megabytes, however changes will only
> happen at the tail end (recently added rows).
The tail is a relative position - except for the case where you add
temporary records to a constant default set, everything in the tail will
move, at least relatively, to the head after some time.
> If we could reduce the
> amount of time spent in a vacuum state it would help us a lot.
Rather: If we can reduce the time spent in a locked state while
vacuuming, it would help a lot. Being in a vacuum is not the issue -
even permanent vacuuming need not be an issue, if the locks it uses are
suitably short-time.
Sevo
--
sevo@ip23.net
From pgsql-hackers-owner+M5911@hub.org Thu Aug 17 21:11:20 2000
Received: from hub.org (root@hub.org [216.126.84.1])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id VAA01882
for <pgman@candle.pha.pa.us>; Thu, 17 Aug 2000 21:11:20 -0400 (EDT)
Received: from hub.org (majordom@localhost [127.0.0.1])
by hub.org (8.10.1/8.10.1) with SMTP id e7I119m80626;
Thu, 17 Aug 2000 21:01:09 -0400 (EDT)
Received: from acheron.rime.com.au (root@albatr.lnk.telstra.net [139.130.54.222])
by hub.org (8.10.1/8.10.1) with ESMTP id e7I0wMm79870
for <pgsql-hackers@postgresql.org>; Thu, 17 Aug 2000 20:58:22 -0400 (EDT)
Received: from oberon (Oberon.rime.com.au [203.8.195.100])
by acheron.rime.com.au (8.9.3/8.9.3) with SMTP id KAA03215;
Fri, 18 Aug 2000 10:58:25 +1000
Message-Id: <3.0.5.32.20000818105835.0280ade0@mail.rhyme.com.au>
X-Sender: pjw@mail.rhyme.com.au
X-Mailer: QUALCOMM Windows Eudora Pro Version 3.0.5 (32)
Date: Fri, 18 Aug 2000 10:58:35 +1000
To: Chris Bitmead <chrisb@nimrod.itg.telstra.com.au>,
Ben Adida <ben@openforce.net>
From: Philip Warner <pjw@rhyme.com.au>
Subject: Re: [HACKERS] Inserting a select statement result into another
table
Cc: Andrew Selle <aselle@upl.cs.wisc.edu>, pgsql-hackers@postgresql.org
In-Reply-To: <399C7689.2DDDAD1D@nimrod.itg.telecom.com.au>
References: <20000817130517.A10909@upl.cs.wisc.edu>
<399BF555.43FB70C8@openforce.net>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
X-Mailing-List: pgsql-hackers@postgresql.org
Precedence: bulk
Sender: pgsql-hackers-owner@hub.org
Status: O
At 09:34 18/08/00 +1000, Chris Bitmead wrote:
>
>He does ask a legitimate question though. If you are going to have a
>LIMIT feature (which of course is not pure SQL), there seems no reason
>you shouldn't be able to insert the result into a table.
This feature is supported by two commercial DBs: Dec/RDB and SQL/Server. I
have no idea if Oracle supports it, but it is such a *useful* feature that
I would be very surprised if it didn't.
>Ben Adida wrote:
>>
>> What is the purpose you're trying to accomplish with this order by? No
matter what, all the
>> rows where done='f' will be inserted, and you will not be left with any
indication of that
>> order once the rows are in the todolist table.
I don't know what his *purpose* was, but the query should only insert the
first two rows from the select bacause of the limit).
>> Andrew Selle wrote:
>>
>> > Alright. My situation is this. I have a list of things that need to
be done
>> > in a table called tasks. I have a list of users who will complete
these tasks.
>> > I want these users to be able to come in and "claim" the top 2 most
recent tasks
>> > that have been added. These tasks then get stored in a table called
todolist
>> > which stores who claimed the task, the taskid, and when the task was
claimed.
>> > For each time someone wants to claim some number of tasks, I want to
do something
>> > like
>> >
>> > INSERT INTO todolist
>> > SELECT taskid,'1',now()
>> > FROM tasks
>> > WHERE done='f'
>> > ORDER BY submit DESC
>> > LIMIT 2;
----------------------------------------------------------------
Philip Warner | __---_____
Albatross Consulting Pty. Ltd. |----/ - \
(A.B.N. 75 008 659 498) | /(@) ______---_
Tel: (+61) 0500 83 82 81 | _________ \
Fax: (+61) 0500 83 82 82 | ___________ |
Http://www.rhyme.com.au | / \|
| --________--
PGP key available upon request, | /
and from pgp5.ai.mit.edu:11371 |/
From pgsql-hackers-owner+M8931@postgresql.org Thu May 17 19:14:23 2001
Return-path: <pgsql-hackers-owner+M8931@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4HNEMd04329
for <pgman@candle.pha.pa.us>; Thu, 17 May 2001 19:14:22 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4HNBbA24259;
Thu, 17 May 2001 19:11:37 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M8931@postgresql.org)
Received: from sss.pgh.pa.us (sss.pgh.pa.us [216.151.103.158])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4HN5SA22678
for <pgsql-hackers@postgreSQL.org>; Thu, 17 May 2001 19:05:28 -0400 (EDT)
(envelope-from tgl@sss.pgh.pa.us)
Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1])
by sss.pgh.pa.us (8.11.3/8.11.3) with ESMTP id f4HN5OR12836
for <pgsql-hackers@postgreSQL.org>; Thu, 17 May 2001 19:05:24 -0400 (EDT)
To: pgsql-hackers@postgresql.org
Subject: [HACKERS] Plans for solving the VACUUM problem
Date: Thu, 17 May 2001 19:05:24 -0400
Message-ID: <12833.990140724@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: ORr
I have been thinking about the problem of VACUUM and how we might fix it
for 7.2. Vadim has suggested that we should attack this by implementing
an overwriting storage manager and transaction UNDO, but I'm not totally
comfortable with that approach: it seems to me that it's an awfully large
change in the way Postgres works. Instead, here is a sketch of an attack
that I think fits better into the existing system structure.
First point: I don't think we need to get rid of VACUUM, exactly. What
we want for 24x7 operation is to be able to do whatever housekeeping we
need without locking out normal transaction processing for long intervals.
We could live with routine VACUUMs if they could run in parallel with
reads and writes of the table being vacuumed. They don't even have to run
in parallel with schema updates of the target table (CREATE/DROP INDEX,
ALTER TABLE, etc). Schema updates aren't things you do lightly for big
tables anyhow. So what we want is more of a "background VACUUM" than a
"no VACUUM" solution.
Second: if VACUUM can run in the background, then there's no reason not
to run it fairly frequently. In fact, it could become an automatically
scheduled activity like CHECKPOINT is now, or perhaps even a continuously
running daemon (which was the original conception of it at Berkeley, BTW).
This is important because it means that VACUUM doesn't have to be perfect.
The existing VACUUM code goes to huge lengths to ensure that it compacts
the table as much as possible. We don't need that; if we miss some free
space this time around, but we can expect to get it the next time (or
eventually), we can be happy. This leads to thinking of space management
in terms of steady-state behavior, rather than the periodic "big bang"
approach that VACUUM represents now.
But having said that, there's no reason to remove the existing VACUUM
code: we can keep it around for situations where you need to crunch a
table as much as possible and you can afford to lock the table while
you do it. The new code would be a new command, maybe "VACUUM LAZY"
(or some other name entirely).
Enough handwaving, what about specifics?
1. Forget moving tuples from one page to another. Doing that in a
transaction-safe way is hugely expensive and complicated. Lazy VACUUM
will only delete dead tuples and coalesce the free space thus made
available within each page of a relation.
2. This does no good unless there's a provision to re-use that free space.
To do that, I propose a free space map (FSM) kept in shared memory, which
will tell backends which pages of a relation have free space. Only if the
FSM shows no free space available will the relation be extended to insert
a new or updated tuple.
3. Lazy VACUUM processes a table in five stages:
A. Scan relation looking for dead tuples; accumulate a list of their
TIDs, as well as info about existing free space. (This pass is
completely read-only and so incurs no WAL traffic.)
B. Remove index entries for the dead tuples. (See below for details.)
C. Physically delete dead tuples and compact free space on their pages.
D. Truncate any completely-empty pages at relation's end. (Optional,
see below.)
E. Create/update FSM entry for the table.
Note that this is crash-safe as long as the individual update operations
are atomic (which can be guaranteed by WAL entries for them). If a tuple
is dead, we care not whether its index entries are still around or not;
so there's no risk to logical consistency.
4. Observe that lazy VACUUM need not really be a transaction at all, since
there's nothing it does that needs to be cancelled or undone if it is
aborted. This means that its WAL entries do not have to hang around past
the next checkpoint, which solves the huge-WAL-space-usage problem that
people have noticed while VACUUMing large tables under 7.1.
5. Also note that there's nothing saying that lazy VACUUM must do the
entire table in one go; once it's accumulated a big enough batch of dead
tuples, it can proceed through steps B,C,D,E even though it's not scanned
the whole table. This avoids a rather nasty problem that VACUUM has
always had with running out of memory on huge tables.
Free space map details
----------------------
I envision the FSM as a shared hash table keyed by table ID, with each
entry containing a list of page numbers and free space in each such page.
The FSM is empty at system startup and is filled by lazy VACUUM as it
processes each table. Backends then decrement/remove page entries as they
use free space.
Critical point: the FSM is only a hint and does not have to be perfectly
accurate. It can omit space that's actually available without harm, and
if it claims there's more space available on a page than there actually
is, we haven't lost much except a wasted ReadBuffer cycle. This allows
us to take shortcuts in maintaining it. In particular, we can constrain
the FSM to a prespecified size, which is critical for keeping it in shared
memory. We just discard entries (pages or whole relations) as necessary
to keep it under budget. Obviously, we'd not bother to make entries in
the first place for pages with only a little free space. Relation entries
might be discarded on a least-recently-used basis.
Accesses to the FSM could create contention problems if we're not careful.
I think this can be dealt with by having each backend remember (in its
relcache entry for a table) the page number of the last page it chose from
the FSM to insert into. That backend will keep inserting new tuples into
that same page, without touching the FSM, as long as there's room there.
Only then does it go back to the FSM, update or remove that page entry,
and choose another page to start inserting on. This reduces the access
load on the FSM from once per tuple to once per page. (Moreover, we can
arrange that successive backends consulting the FSM pick different pages
if possible. Then, concurrent inserts will tend to go to different pages,
reducing contention for shared buffers; yet any single backend does
sequential inserts in one page, so that a bulk load doesn't cause
disk traffic scattered all over the table.)
The FSM can also cache the overall relation size, saving an lseek kernel
call whenever we do have to extend the relation for lack of internal free
space. This will help pay for the locking cost of accessing the FSM.
Locking issues
--------------
We will need two extensions to the lock manager:
1. A new lock type that allows concurrent reads and writes
(AccessShareLock, RowShareLock, RowExclusiveLock) but not anything else.
Lazy VACUUM will grab this type of table lock to ensure the table schema
doesn't change under it. Call it a VacuumLock until we think of a better
name.
2. A "conditional lock" operation that acquires a lock if available, but
doesn't block if not.
The conditional lock will be used by lazy VACUUM to try to upgrade its
VacuumLock to an AccessExclusiveLock at step D (truncate table). If it's
able to get exclusive lock, it's safe to truncate any unused end pages.
Without exclusive lock, it's not, since there might be concurrent
transactions scanning or inserting into the empty pages. We do not want
lazy VACUUM to block waiting to do this, since if it does that it will
create a lockout situation (reader/writer transactions will stack up
behind it in the lock queue while everyone waits for the existing
reader/writer transactions to finish). Better to not do the truncation.
Another place where lazy VACUUM may be unable to do its job completely
is in compaction of space on individual disk pages. It can physically
move tuples to perform compaction only if there are not currently any
other backends with pointers into that page (which can be tested by
looking to see if the buffer reference count is one). Again, we punt
and leave the space to be compacted next time if we can't do it right
away.
The fact that inserted/updated tuples might wind up anywhere in the table,
not only at the end, creates no headaches except for heap_update. That
routine needs buffer locks on both the page containing the old tuple and
the page that will contain the new. To avoid possible deadlocks between
different backends locking the same two pages in opposite orders, we need
to constrain the lock ordering used by heap_update. This is doable but
will require slightly more code than is there now.
Index access method improvements
--------------------------------
Presently, VACUUM deletes index tuples by doing a standard index scan
and checking each returned index tuple to see if it points at any of
the tuples to be deleted. If so, the index AM is called back to delete
the tested index tuple. This is horribly inefficient: it means one trip
into the index AM (with associated buffer lock/unlock and search overhead)
for each tuple in the index, plus another such trip for each tuple actually
deleted.
This is mainly a problem of a poorly chosen API. The index AMs should
offer a "bulk delete" call, which is passed a sorted array of main-table
TIDs. The loop over the index tuples should happen internally to the
index AM. At least in the case of btree, this could be done by a
sequential scan over the index pages, which avoids the random I/O of an
index-order scan and so should offer additional speedup.
Further out (possibly not for 7.2), we should also look at making the
index AMs responsible for shrinking indexes during deletion, or perhaps
via a separate "vacuum index" API. This can be done without exclusive
locks on the index --- the original Lehman & Yao concurrent-btrees paper
didn't describe how, but more recent papers show how to do it. As with
the main tables, I think it's sufficient to recycle freed space within
the index, and not necessarily try to give it back to the OS.
We will also want to look at upgrading the non-btree index types to allow
concurrent operations. This may be a research problem; I don't expect to
touch that issue for 7.2. (Hence, lazy VACUUM on tables with non-btree
indexes will still create lockouts until this is addressed. But note that
the lockout only lasts through step B of the VACUUM, not the whole thing.)
There you have it. If people like this, I'm prepared to commit to
making it happen for 7.2. Comments, objections, better ideas?
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly
From tgl@sss.pgh.pa.us Fri May 18 01:41:34 2001
Return-path: <tgl@sss.pgh.pa.us>
Received: from sss.pgh.pa.us (tgl@sss.pgh.pa.us [216.151.103.158])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4I5fWd18922
for <pgman@candle.pha.pa.us>; Fri, 18 May 2001 01:41:32 -0400 (EDT)
Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1])
by sss.pgh.pa.us (8.11.3/8.11.3) with ESMTP id f4I5fYR14013;
Fri, 18 May 2001 01:41:34 -0400 (EDT)
To: Bruce Momjian <pgman@candle.pha.pa.us>
cc: pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
In-Reply-To: <200105180227.f4I2Rpa13258@candle.pha.pa.us>
References: <200105180227.f4I2Rpa13258@candle.pha.pa.us>
Comments: In-reply-to Bruce Momjian <pgman@candle.pha.pa.us>
message dated "Thu, 17 May 2001 22:27:51 -0400"
Date: Fri, 18 May 2001 01:41:33 -0400
Message-ID: <14010.990164493@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
Status: ORr
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> The only question I have is about the Free Space Map. It would seem
> better to me if we could get this map closer to the table itself, rather
> than having every table of every database mixed into the same shared
> memory area. I can just see random table access clearing out most of
> the map cache and perhaps making it less useless.
What random access? Read transactions will never touch the FSM at all.
As for writes, seems to me the places you are writing are exactly the
places you need info for.
You make a good point, which is that we don't want a schedule-driven
VACUUM to load FSM entries for unused tables into the map at the cost
of throwing out entries that *are* being used. But it seems to me that
that's easily dealt with if we recognize the risk.
> It would be nice if we could store the map on the first page of the disk
> table, or store it in a flat file per table. I know both of these ideas
> will not work,
You said it. What's wrong with shared memory? You can't get any closer
than shared memory: keeping maps in the files would mean you'd need to
chew up shared-buffer space to get at them. (And what was that about
random accesses causing your maps to get dropped? That would happen
for sure if they live in shared buffers.)
Another problem with keeping stuff in the first page: what happens when
the table gets big enough that 8k of map data isn't really enough?
With a shared-memory area, we can fairly easily allocate a variable
amount of space based on total size of a relation vs. total size of
relations under management.
It is true that a shared-memory map would be useless at system startup,
until VACUUM has run and filled in some info. But I don't see that as
a big drawback. People who aren't developers like us don't restart
their postmasters every five minutes.
> Another advantage of centralization is that we can record update/delete
> counters per table, helping tell vacuum where to vacuum next. Vacuum
> roaming around looking for old tuples seems wasteful.
Indeed. But I thought you were arguing against centralization?
regards, tom lane
From pgsql-hackers-owner+M8982@postgresql.org Fri May 18 14:13:26 2001
Return-path: <pgsql-hackers-owner+M8982@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4IIDPd08167
for <pgman@candle.pha.pa.us>; Fri, 18 May 2001 14:13:25 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4IICbA12956;
Fri, 18 May 2001 14:12:37 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M8982@postgresql.org)
Received: from ra.sai.msu.su (ra.sai.msu.su [158.250.29.2])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4IFlDA39367
for <pgsql-hackers@postgresql.org>; Fri, 18 May 2001 11:47:13 -0400 (EDT)
(envelope-from oleg@sai.msu.su)
Received: from ra (ra [158.250.29.2])
by ra.sai.msu.su (8.9.3/8.9.3) with ESMTP id SAA17114;
Fri, 18 May 2001 18:45:46 +0300 (GMT)
Date: Fri, 18 May 2001 18:45:46 +0300 (GMT)
From: Oleg Bartunov <oleg@sai.msu.su>
X-X-Sender: <megera@ra.sai.msu.su>
To: Tom Lane <tgl@sss.pgh.pa.us>
cc: <pgsql-hackers@postgresql.org>
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
In-Reply-To: <12833.990140724@sss.pgh.pa.us>
Message-ID: <Pine.GSO.4.33.0105181830450.12431-100000@ra.sai.msu.su>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
On Thu, 17 May 2001, Tom Lane wrote:
>
> We will also want to look at upgrading the non-btree index types to allow
> concurrent operations. This may be a research problem; I don't expect to
> touch that issue for 7.2. (Hence, lazy VACUUM on tables with non-btree
> indexes will still create lockouts until this is addressed. But note that
> the lockout only lasts through step B of the VACUUM, not the whole thing.)
am I right you plan to work with GiST indexes as well ?
We read a paper "Concurrency and Recovery in Generalized Search Trees"
by Marcel Kornacker, C. Mohan, Joseph Hellerstein
(http://citeseer.nj.nec.com/kornacker97concurrency.html)
and probably we could go in this direction. Right now we're working
on adding of multi-key support to GiST.
btw, I have a question about function gistPageAddItem in gist.c
it just decompress - compress key and calls PageAddItem to
write tuple. We don't understand why do we need this function -
why not use PageAddItem function. Adding multi-key support requires
a lot of work and we don't want to waste our efforts and time.
We already done some tests (gistPageAddItem -> PageAddItem) and
everything is ok. Bruce, you're enthuasistic in removing unused code :-)
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
>
Regards,
Oleg
_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?
http://www.postgresql.org/search.mpl
From pgsql-hackers-owner+M8987@postgresql.org Fri May 18 14:54:09 2001
Return-path: <pgsql-hackers-owner+M8987@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4IIs9d11463
for <pgman@candle.pha.pa.us>; Fri, 18 May 2001 14:54:09 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4IIrSA32621;
Fri, 18 May 2001 14:53:28 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M8987@postgresql.org)
Received: from ra.sai.msu.su (ra.sai.msu.su [158.250.29.2])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4IHBIA83136
for <pgsql-hackers@postgresql.org>; Fri, 18 May 2001 13:11:43 -0400 (EDT)
(envelope-from oleg@sai.msu.su)
Received: from ra (ra [158.250.29.2])
by ra.sai.msu.su (8.9.3/8.9.3) with ESMTP id UAA18957;
Fri, 18 May 2001 20:10:10 +0300 (GMT)
Date: Fri, 18 May 2001 20:10:10 +0300 (GMT)
From: Oleg Bartunov <oleg@sai.msu.su>
X-X-Sender: <megera@ra.sai.msu.su>
To: Tom Lane <tgl@sss.pgh.pa.us>
cc: <pgsql-hackers@postgresql.org>
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
In-Reply-To: <20032.990203902@sss.pgh.pa.us>
Message-ID: <Pine.GSO.4.33.0105181947520.12431-100000@ra.sai.msu.su>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
On Fri, 18 May 2001, Tom Lane wrote:
> Oleg Bartunov <oleg@sai.msu.su> writes:
> > On Thu, 17 May 2001, Tom Lane wrote:
> >> We will also want to look at upgrading the non-btree index types to allow
> >> concurrent operations.
>
> > am I right you plan to work with GiST indexes as well ?
> > We read a paper "Concurrency and Recovery in Generalized Search Trees"
> > by Marcel Kornacker, C. Mohan, Joseph Hellerstein
> > (http://citeseer.nj.nec.com/kornacker97concurrency.html)
> > and probably we could go in this direction. Right now we're working
> > on adding of multi-key support to GiST.
Another paper to read:
"Efficient Concurrency Control in Multidimensional Access Methods"
by Kaushik Chakrabarti
http://www.ics.uci.edu/~kaushik/research/pubs.html
>
> Yes, GIST should be upgraded to do concurrency. But I have no objection
> if you want to work on multi-key support first.
>
> My feeling is that a few releases from now we will have btree and GIST
> as the preferred/well-supported index types. Hash and rtree might go
> away altogether --- AFAICS they don't do anything that's not done as
> well or better by btree or GIST, so what's the point of maintaining
> them?
Cool ! We could write rtree (and btree) ops using GiST. We have already
realization of rtree for box ops and there are no problem to write
additional ops for points, polygons etc.
>
> > btw, I have a question about function gistPageAddItem in gist.c
> > it just decompress - compress key and calls PageAddItem to
> > write tuple. We don't understand why do we need this function -
>
> The comment says
>
> ** Take a compressed entry, and install it on a page. Since we now know
> ** where the entry will live, we decompress it and recompress it using
> ** that knowledge (some compression routines may want to fish around
> ** on the page, for example, or do something special for leaf nodes.)
>
> Are you prepared to say that you will no longer support the ability for
> GIST compression routines to do those things? That seems shortsighted.
>
No-no !!! we don't intend to lose that (compression) functionality.
there are several reason we want to eliminate gistPageAddItem:
1. It seems there are no examples where compress uses information about
the page.
2. There is some discrepancy between calculation of free space on page and
the size of tuple saved on page - calculation of free space on page
by gistNoSpace uses compressed tuple but tuple itself saved after
recompression. It's possible that size of tupple could changed
after recompression.
3. decompress/compress could slowdown insert because it happens
for every tuple.
4. Currently gistPageAddItem is broken because it's not toast safe
(see call gist_tuple_replacekey in gistPageAddItem)
Right now we use #define GIST_PAGEADDITEM in gist.c and
working with original PageAddItem. If people insist on gistPageAddItem
we'll totally rewrite it. But for now we have enough job to do.
> regards, tom lane
>
Regards,
Oleg
_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
From pgsql-hackers-owner+M9001@postgresql.org Fri May 18 20:22:26 2001
Return-path: <pgsql-hackers-owner+M9001@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4J0MPd19637
for <pgman@candle.pha.pa.us>; Fri, 18 May 2001 20:22:25 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4J0LsA39106;
Fri, 18 May 2001 20:21:54 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9001@postgresql.org)
Received: from mailer.sectorbase.com (mailer.sectorbase.com [63.88.121.2])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4J098A35204
for <pgsql-hackers@postgreSQL.org>; Fri, 18 May 2001 20:09:08 -0400 (EDT)
(envelope-from vmikheev@SECTORBASE.COM)
Received: (qmail 61421 invoked by uid 503); 19 May 2001 00:09:04 -0000
Received: from unknown (HELO sectorbase2.sectorbase.com) (192.168.254.2)
by 192.168.254.252 with SMTP; 19 May 2001 00:09:04 -0000
Received: by sectorbase2.sectorbase.com with Internet Mail Service (5.5.2653.19)
id <LG3CCVAC>; Fri, 18 May 2001 17:08:14 -0700
Message-ID: <3705826352029646A3E91C53F7189E3201662C@sectorbase2.sectorbase.com>
From: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>
To: "'Tom Lane'" <tgl@sss.pgh.pa.us>, pgsql-hackers@postgresql.org
Subject: RE: [HACKERS] Plans for solving the VACUUM problem
Date: Fri, 18 May 2001 17:08:07 -0700
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
Content-Type: text/plain;
charset="iso-8859-1"
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: ORr
> I have been thinking about the problem of VACUUM and how we
> might fix it for 7.2. Vadim has suggested that we should
> attack this by implementing an overwriting storage manager
> and transaction UNDO, but I'm not totally comfortable with
> that approach: it seems to me that it's an awfully large
> change in the way Postgres works.
I'm not sure if we should implement overwriting smgr at all.
I was/is going to solve space reusing problem with non-overwriting
one, though I'm sure that we have to reimplement it (> 1 table
per data file, stored on disk FSM etc).
> Second: if VACUUM can run in the background, then there's no
> reason not to run it fairly frequently. In fact, it could become
> an automatically scheduled activity like CHECKPOINT is now,
> or perhaps even a continuously running daemon (which was the
> original conception of it at Berkeley, BTW).
And original authors concluded that daemon was very slow in
reclaiming dead space, BTW.
> 3. Lazy VACUUM processes a table in five stages:
> A. Scan relation looking for dead tuples;...
> B. Remove index entries for the dead tuples...
> C. Physically delete dead tuples and compact free space...
> D. Truncate any completely-empty pages at relation's end.
> E. Create/update FSM entry for the table.
...
> If a tuple is dead, we care not whether its index entries are still
> around or not; so there's no risk to logical consistency.
What does this sentence mean? We canNOT remove dead heap tuple untill
we know that there are no index tuples referencing it and your A,B,C
reflect this, so ..?
> Another place where lazy VACUUM may be unable to do its job completely
> is in compaction of space on individual disk pages. It can physically
> move tuples to perform compaction only if there are not currently any
> other backends with pointers into that page (which can be tested by
> looking to see if the buffer reference count is one). Again, we punt
> and leave the space to be compacted next time if we can't do it right
> away.
We could keep share buffer lock (or add some other kind of lock)
untill tuple projected - after projection we need not to read data
for fetched tuple from shared buffer and time between fetching
tuple and projection is very short, so keeping lock on buffer will
not impact concurrency significantly.
Or we could register callback cleanup function with buffer so bufmgr
would call it when refcnt drops to 0.
> Presently, VACUUM deletes index tuples by doing a standard index
> scan and checking each returned index tuple to see if it points
> at any of the tuples to be deleted. If so, the index AM is called
> back to delete the tested index tuple. This is horribly inefficient:
...
> This is mainly a problem of a poorly chosen API. The index AMs
> should offer a "bulk delete" call, which is passed a sorted array
> of main-table TIDs. The loop over the index tuples should happen
> internally to the index AM.
I agreed with others who think that the main problem of index cleanup
is reading all index data pages to remove some index tuples. You told
youself about partial heap scanning - so for each scanned part of table
you'll have to read all index pages again and again - very good way to
trash buffer pool with big indices.
Well, probably it's ok for first implementation and you'll win some CPU
with "bulk delete" - I'm not sure how much, though, and there is more
significant issue with index cleanup if table is not locked exclusively:
concurrent index scan returns tuple (and unlock index page), heap_fetch
reads table row and find that it's dead, now index scan *must* find
current index tuple to continue, but background vacuum could already
remove that index tuple => elog(FATAL, "_bt_restscan: my bits moved...");
Two ways: hold index page lock untill heap tuple is checked or (rough
schema)
store info in shmem (just IndexTupleData.t_tid and flag) that an index tuple
is used by some scan so cleaner could change stored TID (get one from prev
index tuple) and set flag to help scan restore its current position on
return.
I'm particularly interested in discussing this issue because of it must be
resolved for UNDO and chosen way will affect in what volume we'll be able
to implement dirty reads (first way doesn't allow to implement them in full
- ie selects with joins, - but good enough to resolve RI constraints
concurrency issue).
> There you have it. If people like this, I'm prepared to commit to
> making it happen for 7.2. Comments, objections, better ideas?
Well, my current TODO looks as (ORDER BY PRIORITY DESC):
1. UNDO;
2. New SMGR;
3. Space reusing.
and I cannot commit at this point anything about 3. So, why not to refine
vacuum if you want it. I, personally, was never be able to convince myself
to spend time for this.
Vadim
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
From pgsql-hackers-owner+M9006@postgresql.org Fri May 18 21:04:21 2001
Return-path: <pgsql-hackers-owner+M9006@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4J14Kd22405
for <pgman@candle.pha.pa.us>; Fri, 18 May 2001 21:04:20 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4J13gA51252;
Fri, 18 May 2001 21:03:42 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9006@postgresql.org)
Received: from sss.pgh.pa.us (sss.pgh.pa.us [216.151.103.158])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4J0w5A49229
for <pgsql-hackers@postgreSQL.org>; Fri, 18 May 2001 20:58:05 -0400 (EDT)
(envelope-from tgl@sss.pgh.pa.us)
Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1])
by sss.pgh.pa.us (8.11.3/8.11.3) with ESMTP id f4J0RFR27251;
Fri, 18 May 2001 20:27:16 -0400 (EDT)
To: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>
cc: pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
In-Reply-To: <3705826352029646A3E91C53F7189E3201662C@sectorbase2.sectorbase.com>
References: <3705826352029646A3E91C53F7189E3201662C@sectorbase2.sectorbase.com>
Comments: In-reply-to "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>
message dated "Fri, 18 May 2001 17:08:07 -0700"
Date: Fri, 18 May 2001 20:27:15 -0400
Message-ID: <27248.990232035@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
"Mikheev, Vadim" <vmikheev@SECTORBASE.COM> writes:
>> If a tuple is dead, we care not whether its index entries are still
>> around or not; so there's no risk to logical consistency.
> What does this sentence mean? We canNOT remove dead heap tuple untill
> we know that there are no index tuples referencing it and your A,B,C
> reflect this, so ..?
Sorry if it wasn't clear. I meant that if the vacuum process fails
after removing an index tuple but before removing the (dead) heap tuple
it points to, there's no need to try to undo. That state is OK, and
when we next get a chance to vacuum we'll still be able to finish
removing the heap tuple.
>> Another place where lazy VACUUM may be unable to do its job completely
>> is in compaction of space on individual disk pages. It can physically
>> move tuples to perform compaction only if there are not currently any
>> other backends with pointers into that page (which can be tested by
>> looking to see if the buffer reference count is one). Again, we punt
>> and leave the space to be compacted next time if we can't do it right
>> away.
> We could keep share buffer lock (or add some other kind of lock)
> untill tuple projected - after projection we need not to read data
> for fetched tuple from shared buffer and time between fetching
> tuple and projection is very short, so keeping lock on buffer will
> not impact concurrency significantly.
Or drop the pin on the buffer to show we no longer have a pointer to it.
I'm not sure that the time to do projection is short though --- what
if there are arbitrary user-defined functions in the quals or the
projection targetlist?
> Or we could register callback cleanup function with buffer so bufmgr
> would call it when refcnt drops to 0.
Hmm ... might work. There's no guarantee that the refcnt would drop to
zero before the current backend exits, however. Perhaps set a flag in
the shared buffer header, and the last guy to drop his pin is supposed
to do the cleanup? But then you'd be pushing VACUUM's work into
productive transactions, which is probably not the way to go.
>> This is mainly a problem of a poorly chosen API. The index AMs
>> should offer a "bulk delete" call, which is passed a sorted array
>> of main-table TIDs. The loop over the index tuples should happen
>> internally to the index AM.
> I agreed with others who think that the main problem of index cleanup
> is reading all index data pages to remove some index tuples.
For very small numbers of tuples that might be true. But I'm not
convinced it's worth worrying about. If there aren't many tuples to
be freed, perhaps VACUUM shouldn't do anything at all.
> Well, probably it's ok for first implementation and you'll win some CPU
> with "bulk delete" - I'm not sure how much, though, and there is more
> significant issue with index cleanup if table is not locked exclusively:
> concurrent index scan returns tuple (and unlock index page), heap_fetch
> reads table row and find that it's dead, now index scan *must* find
> current index tuple to continue, but background vacuum could already
> remove that index tuple => elog(FATAL, "_bt_restscan: my bits moved...");
Hm. Good point ...
> Two ways: hold index page lock untill heap tuple is checked or (rough
> schema)
> store info in shmem (just IndexTupleData.t_tid and flag) that an index tuple
> is used by some scan so cleaner could change stored TID (get one from prev
> index tuple) and set flag to help scan restore its current position on
> return.
Another way is to mark the index tuple "gone but not forgotten", so to
speak --- mark it dead without removing it. (We could know that we need
to do that if we see someone else has a buffer pin on the index page.)
In this state, the index scan coming back to work would still be allowed
to find the index tuple, but no other index scan would stop on the
tuple. Later passes of vacuum would eventually remove the index tuple,
whenever vacuum happened to pass through at an instant where no one has
a pin on that index page.
None of these seem real clean though. Needs more thought.
> Well, my current TODO looks as (ORDER BY PRIORITY DESC):
> 1. UNDO;
> 2. New SMGR;
> 3. Space reusing.
> and I cannot commit at this point anything about 3. So, why not to refine
> vacuum if you want it. I, personally, was never be able to convince myself
> to spend time for this.
Okay, good. I was worried that this idea would conflict with what you
were doing, but it seems it won't.
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
From vmikheev@SECTORBASE.COM Fri May 18 21:11:10 2001
Return-path: <vmikheev@SECTORBASE.COM>
Received: from mailer.sectorbase.com (mailer.sectorbase.com [63.88.121.2])
by candle.pha.pa.us (8.10.1/8.10.1) with SMTP id f4J1B9d22806
for <pgman@candle.pha.pa.us>; Fri, 18 May 2001 21:11:09 -0400 (EDT)
Received: (qmail 74783 invoked by uid 503); 19 May 2001 01:11:07 -0000
Received: from sectorbase2.sectorbase.com (192.168.254.2)
by gate1.sectorbase.com with SMTP; 19 May 2001 01:11:07 -0000
Received: by sectorbase2.sectorbase.com with Internet Mail Service (5.5.2653.19)
id <LG3CCV1R>; Fri, 18 May 2001 18:10:16 -0700
Message-ID: <3705826352029646A3E91C53F7189E3201662E@sectorbase2.sectorbase.com>
From: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>
To: "'Bruce Momjian'" <pgman@candle.pha.pa.us>
cc: "'Tom Lane'" <tgl@sss.pgh.pa.us>, pgsql-hackers@postgresql.org
Subject: RE: [HACKERS] Plans for solving the VACUUM problem
Date: Fri, 18 May 2001 18:10:10 -0700
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
Content-Type: text/plain;
charset="iso-8859-1"
Status: OR
> Vadim, can you remind me what UNDO is used for?
Ok, last reminder -:))
On transaction abort, read WAL records and undo (rollback)
changes made in storage. Would allow:
1. Reclaim space allocated by aborted transactions.
2. Implement SAVEPOINTs.
Just to remind -:) - in the event of error discovered by server
- duplicate key, deadlock, command mistyping, etc, - transaction
will be rolled back to the nearest implicit savepoint setted
just before query execution; - or transaction can be aborted by
ROLLBACK TO <savepoint_name> command to some explicit savepoint
setted by user. Transaction rolled back to savepoint may be continued.
3. Reuse transaction IDs on postmaster restart.
4. Split pg_log into small files with ability to remove old ones (which
do not hold statuses for any running transactions).
Vadim
From pgsql-hackers-owner+M9011@postgresql.org Fri May 18 21:44:12 2001
Return-path: <pgsql-hackers-owner+M9011@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4J1iBd01588
for <pgman@candle.pha.pa.us>; Fri, 18 May 2001 21:44:11 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4J1hmA62689;
Fri, 18 May 2001 21:43:48 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9011@postgresql.org)
Received: from sss.pgh.pa.us (sss.pgh.pa.us [216.151.103.158])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4J1bmA60941
for <pgsql-hackers@postgresql.org>; Fri, 18 May 2001 21:37:48 -0400 (EDT)
(envelope-from tgl@sss.pgh.pa.us)
Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1])
by sss.pgh.pa.us (8.11.3/8.11.3) with ESMTP id f4J1bbR27748;
Fri, 18 May 2001 21:37:37 -0400 (EDT)
To: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>
cc: "'Bruce Momjian'" <pgman@candle.pha.pa.us>, pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
In-Reply-To: <3705826352029646A3E91C53F7189E3201662E@sectorbase2.sectorbase.com>
References: <3705826352029646A3E91C53F7189E3201662E@sectorbase2.sectorbase.com>
Comments: In-reply-to "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>
message dated "Fri, 18 May 2001 18:10:10 -0700"
Date: Fri, 18 May 2001 21:37:37 -0400
Message-ID: <27745.990236257@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
"Mikheev, Vadim" <vmikheev@SECTORBASE.COM> writes:
>> Vadim, can you remind me what UNDO is used for?
> Ok, last reminder -:))
> On transaction abort, read WAL records and undo (rollback)
> changes made in storage. Would allow:
> 1. Reclaim space allocated by aborted transactions.
> 2. Implement SAVEPOINTs.
> Just to remind -:) - in the event of error discovered by server
> - duplicate key, deadlock, command mistyping, etc, - transaction
> will be rolled back to the nearest implicit savepoint setted
> just before query execution; - or transaction can be aborted by
> ROLLBACK TO <savepoint_name> command to some explicit savepoint
> setted by user. Transaction rolled back to savepoint may be continued.
> 3. Reuse transaction IDs on postmaster restart.
> 4. Split pg_log into small files with ability to remove old ones (which
> do not hold statuses for any running transactions).
Hm. On the other hand, relying on WAL for undo means you cannot drop
old WAL segments that contain records for any open transaction. We've
already seen several complaints that the WAL logs grow unmanageably huge
when there is a long-running transaction, and I think we'll see a lot
more.
It would be nicer if we could drop WAL records after a checkpoint or two,
even in the presence of long-running transactions. We could do that if
we were only relying on them for crash recovery and not for UNDO.
Looking at the advantages:
1. Space reclamation via UNDO doesn't excite me a whole lot, if we can
make lightweight VACUUM work well. (I definitely don't like the idea
that after a very long transaction fails and aborts, I'd have to wait
another very long time for UNDO to do its thing before I could get on
with my work. Would much rather have the space reclamation happen in
background.)
2. SAVEPOINTs would be awfully nice to have, I agree.
3. Reusing xact IDs would be nice, but there's an answer with a lot less
impact on the system: go to 8-byte xact IDs. Having to shut down the
postmaster when you approach the 4Gb transaction mark isn't going to
impress people who want a 24x7 commitment, anyway.
4. Recycling pg_log would be nice too, but we've already discussed other
hacks that might allow pg_log to be kept finite without depending on
UNDO (or requiring postmaster restarts, IIRC).
I'm sort of thinking that undoing back to a savepoint is the only real
usefulness of WAL-based UNDO. Is it practical to preserve the WAL log
just back to the last savepoint in each xact, not the whole xact?
Another thought: do we need WAL UNDO at all to implement savepoints?
Is there some way we could do them like nested transactions, wherein
each savepoint-to-savepoint segment is given its own transaction number?
Committing multiple xact IDs at once might be a little tricky, but it
seems like a narrow, soluble problem. Implementing UNDO without
creating lots of performance issues looks a lot harder.
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
From tgl@sss.pgh.pa.us Fri May 18 21:37:41 2001
Return-path: <tgl@sss.pgh.pa.us>
Received: from sss.pgh.pa.us (tgl@sss.pgh.pa.us [216.151.103.158])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4J1bdd26573
for <pgman@candle.pha.pa.us>; Fri, 18 May 2001 21:37:39 -0400 (EDT)
Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1])
by sss.pgh.pa.us (8.11.3/8.11.3) with ESMTP id f4J1bbR27748;
Fri, 18 May 2001 21:37:37 -0400 (EDT)
To: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>
cc: "'Bruce Momjian'" <pgman@candle.pha.pa.us>, pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
In-Reply-To: <3705826352029646A3E91C53F7189E3201662E@sectorbase2.sectorbase.com>
References: <3705826352029646A3E91C53F7189E3201662E@sectorbase2.sectorbase.com>
Comments: In-reply-to "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>
message dated "Fri, 18 May 2001 18:10:10 -0700"
Date: Fri, 18 May 2001 21:37:37 -0400
Message-ID: <27745.990236257@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
Status: ORr
"Mikheev, Vadim" <vmikheev@SECTORBASE.COM> writes:
>> Vadim, can you remind me what UNDO is used for?
> Ok, last reminder -:))
> On transaction abort, read WAL records and undo (rollback)
> changes made in storage. Would allow:
> 1. Reclaim space allocated by aborted transactions.
> 2. Implement SAVEPOINTs.
> Just to remind -:) - in the event of error discovered by server
> - duplicate key, deadlock, command mistyping, etc, - transaction
> will be rolled back to the nearest implicit savepoint setted
> just before query execution; - or transaction can be aborted by
> ROLLBACK TO <savepoint_name> command to some explicit savepoint
> setted by user. Transaction rolled back to savepoint may be continued.
> 3. Reuse transaction IDs on postmaster restart.
> 4. Split pg_log into small files with ability to remove old ones (which
> do not hold statuses for any running transactions).
Hm. On the other hand, relying on WAL for undo means you cannot drop
old WAL segments that contain records for any open transaction. We've
already seen several complaints that the WAL logs grow unmanageably huge
when there is a long-running transaction, and I think we'll see a lot
more.
It would be nicer if we could drop WAL records after a checkpoint or two,
even in the presence of long-running transactions. We could do that if
we were only relying on them for crash recovery and not for UNDO.
Looking at the advantages:
1. Space reclamation via UNDO doesn't excite me a whole lot, if we can
make lightweight VACUUM work well. (I definitely don't like the idea
that after a very long transaction fails and aborts, I'd have to wait
another very long time for UNDO to do its thing before I could get on
with my work. Would much rather have the space reclamation happen in
background.)
2. SAVEPOINTs would be awfully nice to have, I agree.
3. Reusing xact IDs would be nice, but there's an answer with a lot less
impact on the system: go to 8-byte xact IDs. Having to shut down the
postmaster when you approach the 4Gb transaction mark isn't going to
impress people who want a 24x7 commitment, anyway.
4. Recycling pg_log would be nice too, but we've already discussed other
hacks that might allow pg_log to be kept finite without depending on
UNDO (or requiring postmaster restarts, IIRC).
I'm sort of thinking that undoing back to a savepoint is the only real
usefulness of WAL-based UNDO. Is it practical to preserve the WAL log
just back to the last savepoint in each xact, not the whole xact?
Another thought: do we need WAL UNDO at all to implement savepoints?
Is there some way we could do them like nested transactions, wherein
each savepoint-to-savepoint segment is given its own transaction number?
Committing multiple xact IDs at once might be a little tricky, but it
seems like a narrow, soluble problem. Implementing UNDO without
creating lots of performance issues looks a lot harder.
regards, tom lane
From pgsql-hackers-owner+M9012@postgresql.org Fri May 18 22:02:39 2001
Return-path: <pgsql-hackers-owner+M9012@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4J22dd03438
for <pgman@candle.pha.pa.us>; Fri, 18 May 2001 22:02:39 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4J22BA67912;
Fri, 18 May 2001 22:02:11 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9012@postgresql.org)
Received: from store.z.zembu.com (nat.zembu.com [209.128.96.253])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4J1uRA66065
for <pgsql-hackers@postgresql.org>; Fri, 18 May 2001 21:56:27 -0400 (EDT)
(envelope-from ncm@zembu.com)
Received: by store.z.zembu.com (Postfix, from userid 509)
id A77BEFDFF; Fri, 18 May 2001 18:56:25 -0700 (PDT)
Date: Fri, 18 May 2001 18:56:25 -0700
To: pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
Message-ID: <20010518185625.F18121@store.zembu.com>
Reply-To: pgsql-hackers@postgresql.org
References: <3705826352029646A3E91C53F7189E3201662E@sectorbase2.sectorbase.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.2.5i
In-Reply-To: <3705826352029646A3E91C53F7189E3201662E@sectorbase2.sectorbase.com>; from vmikheev@SECTORBASE.COM on Fri, May 18, 2001 at 06:10:10PM -0700
From: ncm@zembu.com (Nathan Myers)
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
On Fri, May 18, 2001 at 06:10:10PM -0700, Mikheev, Vadim wrote:
> > Vadim, can you remind me what UNDO is used for?
>
> Ok, last reminder -:))
>
> On transaction abort, read WAL records and undo (rollback)
> changes made in storage. Would allow:
>
> 1. Reclaim space allocated by aborted transactions.
> 2. Implement SAVEPOINTs.
> Just to remind -:) - in the event of error discovered by server
> - duplicate key, deadlock, command mistyping, etc, - transaction
> will be rolled back to the nearest implicit savepoint setted
> just before query execution; - or transaction can be aborted by
> ROLLBACK TO <savepoint_name> command to some explicit savepoint
> setted by user. Transaction rolled back to savepoint may be continued.
> 3. Reuse transaction IDs on postmaster restart.
> 4. Split pg_log into small files with ability to remove old ones (which
> do not hold statuses for any running transactions).
I missed the original discussions; apologies if this has already been
beaten into the ground. But... mightn't sub-transactions be a
better-structured way to expose this service?
Nathan Myers
ncm@zembu.com
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly
From pgsql-hackers-owner+M9016@postgresql.org Fri May 18 23:17:40 2001
Return-path: <pgsql-hackers-owner+M9016@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4J3Hed15250
for <pgman@candle.pha.pa.us>; Fri, 18 May 2001 23:17:40 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4J3HGA88247;
Fri, 18 May 2001 23:17:16 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9016@postgresql.org)
Received: from candle.pha.pa.us (candle.navpoint.com [162.33.245.46])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4J3CwA86943
for <pgsql-hackers@postgresql.org>; Fri, 18 May 2001 23:12:58 -0400 (EDT)
(envelope-from pgman@candle.pha.pa.us)
Received: (from pgman@localhost)
by candle.pha.pa.us (8.10.1/8.10.1) id f4J3Cfs14576;
Fri, 18 May 2001 23:12:41 -0400 (EDT)
From: Bruce Momjian <pgman@candle.pha.pa.us>
Message-ID: <200105190312.f4J3Cfs14576@candle.pha.pa.us>
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
In-Reply-To: <27745.990236257@sss.pgh.pa.us> "from Tom Lane at May 18, 2001 09:37:37
pm"
To: Tom Lane <tgl@sss.pgh.pa.us>
Date: Fri, 18 May 2001 23:12:41 -0400 (EDT)
cc: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>, pgsql-hackers@postgresql.org
X-Mailer: ELM [version 2.4ME+ PL90 (25)]
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
> Another thought: do we need WAL UNDO at all to implement savepoints?
> Is there some way we could do them like nested transactions, wherein
> each savepoint-to-savepoint segment is given its own transaction number?
> Committing multiple xact IDs at once might be a little tricky, but it
> seems like a narrow, soluble problem. Implementing UNDO without
> creating lots of performance issues looks a lot harder.
I am confused why we can't implement subtransactions as part of our
command counter? The counter is already 4 bytes long. Couldn't we
rollback to counter number X-10?
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
From pgsql-hackers-owner+M9017@postgresql.org Fri May 18 23:20:00 2001
Return-path: <pgsql-hackers-owner+M9017@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4J3Jxd15384
for <pgman@candle.pha.pa.us>; Fri, 18 May 2001 23:19:59 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4J3JcA88917;
Fri, 18 May 2001 23:19:38 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9017@postgresql.org)
Received: from sss.pgh.pa.us (sss.pgh.pa.us [216.151.103.158])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4J3FOA87731
for <pgsql-hackers@postgresql.org>; Fri, 18 May 2001 23:15:24 -0400 (EDT)
(envelope-from tgl@sss.pgh.pa.us)
Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1])
by sss.pgh.pa.us (8.11.3/8.11.3) with ESMTP id f4J3FER28239;
Fri, 18 May 2001 23:15:14 -0400 (EDT)
To: Bruce Momjian <pgman@candle.pha.pa.us>
cc: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>, pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
In-Reply-To: <200105190312.f4J3Cfs14576@candle.pha.pa.us>
References: <200105190312.f4J3Cfs14576@candle.pha.pa.us>
Comments: In-reply-to Bruce Momjian <pgman@candle.pha.pa.us>
message dated "Fri, 18 May 2001 23:12:41 -0400"
Date: Fri, 18 May 2001 23:15:13 -0400
Message-ID: <28236.990242113@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> I am confused why we can't implement subtransactions as part of our
> command counter? The counter is already 4 bytes long. Couldn't we
> rollback to counter number X-10?
That'd work within your own transaction, but not from outside it.
After you commit, how will other backends know which command-counter
values of your transaction to believe, and which not?
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/users-lounge/docs/faq.html
From tgl@sss.pgh.pa.us Fri May 18 23:15:13 2001
Return-path: <tgl@sss.pgh.pa.us>
Received: from sss.pgh.pa.us (tgl@sss.pgh.pa.us [216.151.103.158])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4J3FCd15028
for <pgman@candle.pha.pa.us>; Fri, 18 May 2001 23:15:12 -0400 (EDT)
Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1])
by sss.pgh.pa.us (8.11.3/8.11.3) with ESMTP id f4J3FER28239;
Fri, 18 May 2001 23:15:14 -0400 (EDT)
To: Bruce Momjian <pgman@candle.pha.pa.us>
cc: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>, pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
In-Reply-To: <200105190312.f4J3Cfs14576@candle.pha.pa.us>
References: <200105190312.f4J3Cfs14576@candle.pha.pa.us>
Comments: In-reply-to Bruce Momjian <pgman@candle.pha.pa.us>
message dated "Fri, 18 May 2001 23:12:41 -0400"
Date: Fri, 18 May 2001 23:15:13 -0400
Message-ID: <28236.990242113@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
Status: ORr
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> I am confused why we can't implement subtransactions as part of our
> command counter? The counter is already 4 bytes long. Couldn't we
> rollback to counter number X-10?
That'd work within your own transaction, but not from outside it.
After you commit, how will other backends know which command-counter
values of your transaction to believe, and which not?
regards, tom lane
From pgsql-hackers-owner+M9020@postgresql.org Fri May 18 23:44:09 2001
Return-path: <pgsql-hackers-owner+M9020@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4J3i8d16942
for <pgman@candle.pha.pa.us>; Fri, 18 May 2001 23:44:08 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4J3hcA96911;
Fri, 18 May 2001 23:43:38 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9020@postgresql.org)
Received: from candle.pha.pa.us (candle.navpoint.com [162.33.245.46])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4J3U8A92747
for <pgsql-hackers@postgresql.org>; Fri, 18 May 2001 23:30:08 -0400 (EDT)
(envelope-from pgman@candle.pha.pa.us)
Received: (from pgman@localhost)
by candle.pha.pa.us (8.10.1/8.10.1) id f4J3TtI15796;
Fri, 18 May 2001 23:29:55 -0400 (EDT)
From: Bruce Momjian <pgman@candle.pha.pa.us>
Message-ID: <200105190329.f4J3TtI15796@candle.pha.pa.us>
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
In-Reply-To: <28236.990242113@sss.pgh.pa.us> "from Tom Lane at May 18, 2001 11:15:13
pm"
To: Tom Lane <tgl@sss.pgh.pa.us>
Date: Fri, 18 May 2001 23:29:55 -0400 (EDT)
cc: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>, pgsql-hackers@postgresql.org
X-Mailer: ELM [version 2.4ME+ PL90 (25)]
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > I am confused why we can't implement subtransactions as part of our
> > command counter? The counter is already 4 bytes long. Couldn't we
> > rollback to counter number X-10?
>
> That'd work within your own transaction, but not from outside it.
> After you commit, how will other backends know which command-counter
> values of your transaction to believe, and which not?
Seems we would have to store the command counters for the parts of the
transaction that committed, or the ones that were rolled back. Yuck.
I hate to add UNDO complexity just for subtransactions.
Hey, I have an idea. Can we do subtransactions as separate transactions
(as Tom mentioned), and put the subtransaction id's in the WAL, so they
an be safely committed/rolledback as a group?
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?
http://www.postgresql.org/search.mpl
From pgsql-hackers-owner+M9023@postgresql.org Fri May 18 23:56:09 2001
Return-path: <pgsql-hackers-owner+M9023@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4J3u8d17382
for <pgman@candle.pha.pa.us>; Fri, 18 May 2001 23:56:08 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4J3tgA01116;
Fri, 18 May 2001 23:55:42 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9023@postgresql.org)
Received: from sss.pgh.pa.us (sss.pgh.pa.us [216.151.103.158])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4J3hqA97002
for <pgsql-hackers@postgresql.org>; Fri, 18 May 2001 23:43:52 -0400 (EDT)
(envelope-from tgl@sss.pgh.pa.us)
Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1])
by sss.pgh.pa.us (8.11.3/8.11.3) with ESMTP id f4J3hgR28484;
Fri, 18 May 2001 23:43:42 -0400 (EDT)
To: Bruce Momjian <pgman@candle.pha.pa.us>
cc: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>, pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
In-Reply-To: <200105190329.f4J3TtI15796@candle.pha.pa.us>
References: <200105190329.f4J3TtI15796@candle.pha.pa.us>
Comments: In-reply-to Bruce Momjian <pgman@candle.pha.pa.us>
message dated "Fri, 18 May 2001 23:29:55 -0400"
Date: Fri, 18 May 2001 23:43:42 -0400
Message-ID: <28481.990243822@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: ORr
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Hey, I have an idea. Can we do subtransactions as separate transactions
> (as Tom mentioned), and put the subtransaction id's in the WAL, so they
> an be safely committed/rolledback as a group?
It's not quite that easy: all the subtransactions have to commit at
*the same time* from the point of view of other xacts, or you have
consistency problems. So there'd need to be more xact-commit mechanism
than there is now. Snapshots are also interesting; we couldn't use a
single xact ID per backend to show the open-transaction state.
WAL doesn't really enter into it AFAICS...
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
From tgl@sss.pgh.pa.us Fri May 18 23:43:41 2001
Return-path: <tgl@sss.pgh.pa.us>
Received: from sss.pgh.pa.us (tgl@sss.pgh.pa.us [216.151.103.158])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4J3hed16915
for <pgman@candle.pha.pa.us>; Fri, 18 May 2001 23:43:40 -0400 (EDT)
Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1])
by sss.pgh.pa.us (8.11.3/8.11.3) with ESMTP id f4J3hgR28484;
Fri, 18 May 2001 23:43:42 -0400 (EDT)
To: Bruce Momjian <pgman@candle.pha.pa.us>
cc: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>, pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
In-Reply-To: <200105190329.f4J3TtI15796@candle.pha.pa.us>
References: <200105190329.f4J3TtI15796@candle.pha.pa.us>
Comments: In-reply-to Bruce Momjian <pgman@candle.pha.pa.us>
message dated "Fri, 18 May 2001 23:29:55 -0400"
Date: Fri, 18 May 2001 23:43:42 -0400
Message-ID: <28481.990243822@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
Status: ORr
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Hey, I have an idea. Can we do subtransactions as separate transactions
> (as Tom mentioned), and put the subtransaction id's in the WAL, so they
> an be safely committed/rolledback as a group?
It's not quite that easy: all the subtransactions have to commit at
*the same time* from the point of view of other xacts, or you have
consistency problems. So there'd need to be more xact-commit mechanism
than there is now. Snapshots are also interesting; we couldn't use a
single xact ID per backend to show the open-transaction state.
WAL doesn't really enter into it AFAICS...
regards, tom lane
From pgsql-hackers-owner+M9024@postgresql.org Sat May 19 00:05:43 2001
Return-path: <pgsql-hackers-owner+M9024@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4J45hd18105
for <pgman@candle.pha.pa.us>; Sat, 19 May 2001 00:05:43 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4J457A05136;
Sat, 19 May 2001 00:05:07 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9024@postgresql.org)
Received: from candle.pha.pa.us (candle.navpoint.com [162.33.245.46])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4J3vEA01609
for <pgsql-hackers@postgresql.org>; Fri, 18 May 2001 23:57:14 -0400 (EDT)
(envelope-from pgman@candle.pha.pa.us)
Received: (from pgman@localhost)
by candle.pha.pa.us (8.10.1/8.10.1) id f4J3v1h17419;
Fri, 18 May 2001 23:57:01 -0400 (EDT)
From: Bruce Momjian <pgman@candle.pha.pa.us>
Message-ID: <200105190357.f4J3v1h17419@candle.pha.pa.us>
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
In-Reply-To: <28481.990243822@sss.pgh.pa.us> "from Tom Lane at May 18, 2001 11:43:42
pm"
To: Tom Lane <tgl@sss.pgh.pa.us>
Date: Fri, 18 May 2001 23:57:01 -0400 (EDT)
cc: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>, pgsql-hackers@postgresql.org
X-Mailer: ELM [version 2.4ME+ PL90 (25)]
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: ORr
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > Hey, I have an idea. Can we do subtransactions as separate transactions
> > (as Tom mentioned), and put the subtransaction id's in the WAL, so they
> > an be safely committed/rolledback as a group?
>
> It's not quite that easy: all the subtransactions have to commit at
> *the same time* from the point of view of other xacts, or you have
> consistency problems. So there'd need to be more xact-commit mechanism
> than there is now. Snapshots are also interesting; we couldn't use a
> single xact ID per backend to show the open-transaction state.
Yes, I knew that was going to come up that you have to add a lock to the
pg_log that is only in affect when someone is commiting a transaction
with subtransactions. Normal transactions get read/sharedlock, while
subtransaction needs exclusive/writelock.
Seems a lot easier than UNDO. Vadim you mentioned UNDO would allow
space reuse for rolledback transactions, but in most cases the space
reuse is going to be for old copies of committed transactions, right?
Were you going to use WAL to get free space from old copies too?
Vadim, I think I am missing something. You mentioned UNDO would be used
for these cases and I don't understand the purpose of adding what would
seem to be a pretty complex capability:
> 1. Reclaim space allocated by aborted transactions.
Is there really a lot to be saved here vs. old tuples of committed
transactions?
> 2. Implement SAVEPOINTs.
> Just to remind -:) - in the event of error discovered by server
> - duplicate key, deadlock, command mistyping, etc, - transaction
> will be rolled back to the nearest implicit savepoint setted
> just before query execution; - or transaction can be aborted by
> ROLLBACK TO <savepoint_name> command to some explicit savepoint
> setted by user. Transaction rolled back to savepoint may be
> continued.
Discussing, perhaps using multiple transactions.
> 3. Reuse transaction IDs on postmaster restart.
Doesn't seem like a huge win.
> 4. Split pg_log into small files with ability to remove old ones (which
> do not hold statuses for any running transactions).
That one is interesting. Seems the only workaround for that would be to
allow a global scan of all databases and tables to set commit flags,
then shrink pg_log and set XID offset as start of file.
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/users-lounge/docs/faq.html
From pgsql-hackers-owner+M9028@postgresql.org Sat May 19 05:00:37 2001
Return-path: <pgsql-hackers-owner+M9028@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4J90bd29010
for <pgman@candle.pha.pa.us>; Sat, 19 May 2001 05:00:37 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4J8sGA10373;
Sat, 19 May 2001 04:54:16 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9028@postgresql.org)
Received: from bering.webline.dk (83.adsl0.kh.worldonline.dk [213.237.10.83])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4J8coA09586
for <pgsql-hackers@postgreSQL.org>; Sat, 19 May 2001 04:38:53 -0400 (EDT)
(envelope-from kar@webline.dk)
Received: from bering (localhost [127.0.0.1])
by bering.webline.dk (8.11.2/8.10.2/SuSE Linux 8.10.0-0.3) with SMTP id f4J8cUq15144
for <pgsql-hackers@postgreSQL.org>; Sat, 19 May 2001 10:38:30 +0200
Content-Type: text/plain;
charset="iso-8859-1"
From: Kaare Rasmussen <kar@webline.dk>
To: pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
Date: Sat, 19 May 2001 10:38:29 +0200
X-Mailer: KMail [version 1.2]
References: <12833.990140724@sss.pgh.pa.us>
In-Reply-To: <12833.990140724@sss.pgh.pa.us>
MIME-Version: 1.0
Message-ID: <01051910382902.14217@bering>
Content-Transfer-Encoding: 8bit
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
> Second: if VACUUM can run in the background, then there's no reason not
> to run it fairly frequently. In fact, it could become an automatically
> scheduled activity like CHECKPOINT is now, or perhaps even a continuously
> running daemon (which was the original conception of it at Berkeley, BTW).
Maybe it's obvious, but I'd like to mention that you need some way of setting
priority. If it's a daemon, or a process, you an nice it. If not, you need to
implement something by yourself.
--
Kaare Rasmussen --Linux, spil,-- Tlf: 3816 2582
Kaki Data tshirts, merchandize Fax: 3816 2501
Howitzvej 75 Åben 14.00-18.00 Web: www.suse.dk
2000 Frederiksberg Lørdag 11.00-17.00 Email: kar@webline.dk
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
From pgman Sat May 19 08:12:28 2001
Return-path: <pgman>
Received: (from pgman@localhost)
by candle.pha.pa.us (8.10.1/8.10.1) id f4JCCSc15349;
Sat, 19 May 2001 08:12:28 -0400 (EDT)
From: Bruce Momjian <pgman>
Message-ID: <200105191212.f4JCCSc15349@candle.pha.pa.us>
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
In-Reply-To: <200105190357.f4J3v1h17419@candle.pha.pa.us> "from Bruce Momjian
at May 18, 2001 11:57:01 pm"
To: Bruce Momjian <pgman@candle.pha.pa.us>
Date: Sat, 19 May 2001 08:12:28 -0400 (EDT)
cc: Tom Lane <tgl@sss.pgh.pa.us>, "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>,
pgsql-hackers@postgresql.org
X-Mailer: ELM [version 2.4ME+ PL90 (25)]
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII
Status: OR
> > Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > > Hey, I have an idea. Can we do subtransactions as separate transactions
> > > (as Tom mentioned), and put the subtransaction id's in the WAL, so they
> > > an be safely committed/rolledback as a group?
> >
> > It's not quite that easy: all the subtransactions have to commit at
> > *the same time* from the point of view of other xacts, or you have
> > consistency problems. So there'd need to be more xact-commit mechanism
> > than there is now. Snapshots are also interesting; we couldn't use a
> > single xact ID per backend to show the open-transaction state.
>
> Yes, I knew that was going to come up that you have to add a lock to the
> pg_log that is only in affect when someone is commiting a transaction
> with subtransactions. Normal transactions get read/sharedlock, while
> subtransaction needs exclusive/writelock.
I was wrong here. Multiple backends can write to pg_log at the same
time, even subtraction ones. It is just that no backend can read from
pg_log during a subtransaction commit. Acctually, they can if the are
reading a transaction status that is less than the minium active
transaction id, see GetXmaxRecent().
Doesn't seem too bad.
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
From pgsql-hackers-owner+M9034@postgresql.org Sat May 19 08:18:54 2001
Return-path: <pgsql-hackers-owner+M9034@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4JCIsd15698
for <pgman@candle.pha.pa.us>; Sat, 19 May 2001 08:18:54 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4JCI8A86106;
Sat, 19 May 2001 08:18:08 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9034@postgresql.org)
Received: from candle.pha.pa.us (candle.navpoint.com [162.33.245.46])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4JCDoA84410
for <pgsql-hackers@postgresql.org>; Sat, 19 May 2001 08:13:50 -0400 (EDT)
(envelope-from pgman@candle.pha.pa.us)
Received: (from pgman@localhost)
by candle.pha.pa.us (8.10.1/8.10.1) id f4JCCSc15349;
Sat, 19 May 2001 08:12:28 -0400 (EDT)
From: Bruce Momjian <pgman@candle.pha.pa.us>
Message-ID: <200105191212.f4JCCSc15349@candle.pha.pa.us>
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
In-Reply-To: <200105190357.f4J3v1h17419@candle.pha.pa.us> "from Bruce Momjian
at May 18, 2001 11:57:01 pm"
To: Bruce Momjian <pgman@candle.pha.pa.us>
Date: Sat, 19 May 2001 08:12:28 -0400 (EDT)
cc: Tom Lane <tgl@sss.pgh.pa.us>, "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>,
pgsql-hackers@postgresql.org
X-Mailer: ELM [version 2.4ME+ PL90 (25)]
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
> > Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > > Hey, I have an idea. Can we do subtransactions as separate transactions
> > > (as Tom mentioned), and put the subtransaction id's in the WAL, so they
> > > an be safely committed/rolledback as a group?
> >
> > It's not quite that easy: all the subtransactions have to commit at
> > *the same time* from the point of view of other xacts, or you have
> > consistency problems. So there'd need to be more xact-commit mechanism
> > than there is now. Snapshots are also interesting; we couldn't use a
> > single xact ID per backend to show the open-transaction state.
>
> Yes, I knew that was going to come up that you have to add a lock to the
> pg_log that is only in affect when someone is commiting a transaction
> with subtransactions. Normal transactions get read/sharedlock, while
> subtransaction needs exclusive/writelock.
I was wrong here. Multiple backends can write to pg_log at the same
time, even subtraction ones. It is just that no backend can read from
pg_log during a subtransaction commit. Acctually, they can if the are
reading a transaction status that is less than the minium active
transaction id, see GetXmaxRecent().
Doesn't seem too bad.
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
From pgsql-hackers-owner+M9036@postgresql.org Sat May 19 08:30:41 2001
Return-path: <pgsql-hackers-owner+M9036@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4JCUed16878
for <pgman@candle.pha.pa.us>; Sat, 19 May 2001 08:30:41 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4JCTRA90288;
Sat, 19 May 2001 08:29:27 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9036@postgresql.org)
Received: from candle.pha.pa.us (candle.navpoint.com [162.33.245.46])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4JCOxA88564
for <pgsql-hackers@postgresql.org>; Sat, 19 May 2001 08:24:59 -0400 (EDT)
(envelope-from pgman@candle.pha.pa.us)
Received: (from pgman@localhost)
by candle.pha.pa.us (8.10.1/8.10.1) id f4JCNb815894;
Sat, 19 May 2001 08:23:37 -0400 (EDT)
From: Bruce Momjian <pgman@candle.pha.pa.us>
Message-ID: <200105191223.f4JCNb815894@candle.pha.pa.us>
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
In-Reply-To: <28481.990243822@sss.pgh.pa.us> "from Tom Lane at May 18, 2001 11:43:42
pm"
To: Tom Lane <tgl@sss.pgh.pa.us>
Date: Sat, 19 May 2001 08:23:37 -0400 (EDT)
cc: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>, pgsql-hackers@postgresql.org
X-Mailer: ELM [version 2.4ME+ PL90 (25)]
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > Hey, I have an idea. Can we do subtransactions as separate transactions
> > (as Tom mentioned), and put the subtransaction id's in the WAL, so they
> > an be safely committed/rolledback as a group?
>
> It's not quite that easy: all the subtransactions have to commit at
> *the same time* from the point of view of other xacts, or you have
> consistency problems. So there'd need to be more xact-commit mechanism
> than there is now. Snapshots are also interesting; we couldn't use a
> single xact ID per backend to show the open-transaction state.
OK, I have another idea about subtransactions as multiple transaction
ids.
I realize that the snapshot problem would be an issue, because now
instead of looking at your own transaction id, you have to look at
multiple transaction ids. We could do this as a List of xid's, but that
will not scale well.
My idea is for a subtransaction backend to have its own pg_log-style
memory area that shows which transactions it owns and has
committed/aborted. It can have the log start at its start xid, and can
look in pg_log and in there anytime it needs to check the visibility of
a transaction greater than its minium xid. 16k can hold 64k xids, so it
seems it should scale pretty well. (Each xid is two bits in pg_log.)
In fact, multi-query transactions are just a special case of
subtransactions, where all previous subtransactions are
committed/visible. We could use the same pg_log-style memory area for
multi-query transactions, eliminating the command counter and saving 8
bytes overhead per tuple.
Currently, the XMIN/XMAX command counters are used only by the current
transaction, and they are useless once the transaction finishes and take
up 8 bytes on disk.
So, this idea gets us subtransactions and saves 8 bytes overhead. This
reduces our per-tuple overhead from 36 to 28 bytes, a 22% reduction!
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly
From tgl@sss.pgh.pa.us Sat May 19 11:13:12 2001
Return-path: <tgl@sss.pgh.pa.us>
Received: from sss.pgh.pa.us (tgl@sss.pgh.pa.us [216.151.103.158])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4JFDBd10204
for <pgman@candle.pha.pa.us>; Sat, 19 May 2001 11:13:11 -0400 (EDT)
Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1])
by sss.pgh.pa.us (8.11.3/8.11.3) with ESMTP id f4JFDBR00135;
Sat, 19 May 2001 11:13:11 -0400 (EDT)
To: Bruce Momjian <pgman@candle.pha.pa.us>
cc: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>, pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
In-Reply-To: <200105191223.f4JCNb815894@candle.pha.pa.us>
References: <200105191223.f4JCNb815894@candle.pha.pa.us>
Comments: In-reply-to Bruce Momjian <pgman@candle.pha.pa.us>
message dated "Sat, 19 May 2001 08:23:37 -0400"
Date: Sat, 19 May 2001 11:13:11 -0400
Message-ID: <132.990285191@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
Status: OR
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> In fact, multi-query transactions are just a special case of
> subtransactions, where all previous subtransactions are
> committed/visible. We could use the same pg_log-style memory area for
> multi-query transactions, eliminating the command counter and saving 8
> bytes overhead per tuple.
Interesting thought, but command IDs don't act the same as transactions;
in particular, visibility of one scan to another doesn't necessarily
depend on whether the scan has finished.
Possibly that could be taken into account by having different rules for
"do we think it's committed" in the local pg_log than the global one.
Also, this distinction would propagate out of the xact status code;
for example, it wouldn't do for heapam to set the "known committed"
bit on a tuple just because it's from a previous subtransaction of the
current xact. Right now that works because heapam knows the difference
between xacts and commands; it would still have to know the difference.
A much more significant objection is that such a design would eat xact
IDs at a tremendous rate, to no purpose. CommandCounterIncrement is a
cheap operation now, and we do it with abandon. It would not be cheap
if it implied allocating a new xact ID that would eventually need to be
marked committed. I don't mind allocating a new xact ID for each
explicitly-created savepoint, but a new ID per CommandCounterIncrement
is a different story.
regards, tom lane
From pgsql-hackers-owner+M9081@postgresql.org Sun May 20 02:45:24 2001
Return-path: <pgsql-hackers-owner+M9081@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4K6jNN16792
for <pgman@candle.pha.pa.us>; Sun, 20 May 2001 02:45:23 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4K6ihA56252;
Sun, 20 May 2001 02:44:43 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9081@postgresql.org)
Received: from mailer.sectorbase.com (mailer.sectorbase.com [63.88.121.2])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4K6aaA53464
for <pgsql-hackers@postgresql.org>; Sun, 20 May 2001 02:36:36 -0400 (EDT)
(envelope-from vmikheev@sectorbase.com)
Received: (qmail 46626 invoked by uid 503); 20 May 2001 06:36:34 -0000
Received: from din6.sectorbase.com (HELO dune) (63.88.121.76)
by gate1.sectorbase.com with SMTP; 20 May 2001 06:36:34 -0000
Message-ID: <002d01c0e0f7$376b59a0$4c79583f@sectorbase.com>
From: "Vadim Mikheev" <vmikheev@sectorbase.com>
To: "Tom Lane" <tgl@sss.pgh.pa.us>
cc: "'Bruce Momjian'" <pgman@candle.pha.pa.us>, <pgsql-hackers@postgresql.org>
References: <3705826352029646A3E91C53F7189E3201662E@sectorbase2.sectorbase.com> <27745.990236257@sss.pgh.pa.us>
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
Date: Sat, 19 May 2001 23:36:34 -0700
MIME-Version: 1.0
Content-Type: text/plain;
charset="windows-1251"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
> Hm. On the other hand, relying on WAL for undo means you cannot drop
> old WAL segments that contain records for any open transaction. We've
> already seen several complaints that the WAL logs grow unmanageably huge
> when there is a long-running transaction, and I think we'll see a lot
> more.
>
> It would be nicer if we could drop WAL records after a checkpoint or two,
> even in the presence of long-running transactions. We could do that if
> we were only relying on them for crash recovery and not for UNDO.
As you understand this is old, well-known problem in database practice,
described in books. Two ways - either abort too long running transactions
or (/and) compact old log segments: fetch and save (to use for undo)
records of long-running transactions and remove other records. Neither
way is perfect but nothing is perfect at all -:)
> 1. Space reclamation via UNDO doesn't excite me a whole lot, if we can
> make lightweight VACUUM work well. (I definitely don't like the idea
Sorry, but I'm going to consider background vacuum as temporary solution
only. As I've already pointed, original PG authors finally became
disillusioned with the same approach. What is good in using UNDO for 1.
is the fact that WAL records give you *direct* physical access to changes
which should be rolled back.
> that after a very long transaction fails and aborts, I'd have to wait
> another very long time for UNDO to do its thing before I could get on
> with my work. Would much rather have the space reclamation happen in
> background.)
Understandable, but why other transactions should read dirty data again
and again waiting for background vacuum? I think aborted transaction
should take some responsibility for mess made by them -:)
And keeping in mind 2. very long transactions could be continued -:)
> 2. SAVEPOINTs would be awfully nice to have, I agree.
>
> 3. Reusing xact IDs would be nice, but there's an answer with a lot less
> impact on the system: go to 8-byte xact IDs. Having to shut down the
> postmaster when you approach the 4Gb transaction mark isn't going to
> impress people who want a 24x7 commitment, anyway.
+8 bytes in tuple header is not so tiny thing.
> 4. Recycling pg_log would be nice too, but we've already discussed other
> hacks that might allow pg_log to be kept finite without depending on
> UNDO (or requiring postmaster restarts, IIRC).
We did... and didn't get agreement.
> I'm sort of thinking that undoing back to a savepoint is the only real
> usefulness of WAL-based UNDO. Is it practical to preserve the WAL log
> just back to the last savepoint in each xact, not the whole xact?
No, it's not. It's not possible in overwriting systems at all - all
transaction records are required.
> Another thought: do we need WAL UNDO at all to implement savepoints?
> Is there some way we could do them like nested transactions, wherein
> each savepoint-to-savepoint segment is given its own transaction number?
> Committing multiple xact IDs at once might be a little tricky, but it
> seems like a narrow, soluble problem.
Implicit savepoints wouldn't be possible - this is very convenient
feature I've found in Oracle.
And additional code in tqual.c wouldn't be good addition.
> Implementing UNDO without creating lots of performance issues looks
> a lot harder.
What *performance* issues?!
The only issue is additional disk requirements.
Vadim
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly
From pgsql-hackers-owner+M9088@postgresql.org Sun May 20 13:17:50 2001
Return-path: <pgsql-hackers-owner+M9088@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4KHHoN20556
for <pgman@candle.pha.pa.us>; Sun, 20 May 2001 13:17:50 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4KHHJA01746;
Sun, 20 May 2001 13:17:19 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9088@postgresql.org)
Received: from sss.pgh.pa.us (sss.pgh.pa.us [216.151.103.158])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4KH9vA98828
for <pgsql-hackers@postgresql.org>; Sun, 20 May 2001 13:09:57 -0400 (EDT)
(envelope-from tgl@sss.pgh.pa.us)
Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1])
by sss.pgh.pa.us (8.11.3/8.11.3) with ESMTP id f4KH9jR12006;
Sun, 20 May 2001 13:09:46 -0400 (EDT)
To: "Vadim Mikheev" <vmikheev@sectorbase.com>
cc: "'Bruce Momjian'" <pgman@candle.pha.pa.us>, pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
In-Reply-To: <002d01c0e0f7$376b59a0$4c79583f@sectorbase.com>
References: <3705826352029646A3E91C53F7189E3201662E@sectorbase2.sectorbase.com> <27745.990236257@sss.pgh.pa.us> <002d01c0e0f7$376b59a0$4c79583f@sectorbase.com>
Comments: In-reply-to "Vadim Mikheev" <vmikheev@sectorbase.com>
message dated "Sat, 19 May 2001 23:36:34 -0700"
Date: Sun, 20 May 2001 13:09:45 -0400
Message-ID: <12003.990378585@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
"Vadim Mikheev" <vmikheev@sectorbase.com> writes:
>> 1. Space reclamation via UNDO doesn't excite me a whole lot, if we can
>> make lightweight VACUUM work well.
> Sorry, but I'm going to consider background vacuum as temporary solution
> only. As I've already pointed, original PG authors finally became
> disillusioned with the same approach.
How could they become disillusioned with it, when they never tried it?
I know of no evidence that any version of PG has had backgroundable
(non-blocking-to-other-transactions) VACUUM, still less within-relation
space recycling. They may have become disillusioned with the form of
VACUUM that they actually had (ie, the same one we've inherited) --- but
please don't call that "the same approach" I'm proposing.
Certainly, doing VACUUM this way is an experiment that may fail, or may
require further work before it really works well. But I'd appreciate it
if you wouldn't prejudge the results of the experiment.
>> Would much rather have the space reclamation happen in
>> background.)
> Understandable, but why other transactions should read dirty data again
> and again waiting for background vacuum? I think aborted transaction
> should take some responsibility for mess made by them -:)
They might read it again and again before the failed xact gets around to
removing the data, too. You cannot rely on UNDO for correctness; at
most it can be a speed/space optimization. I see no reason to assume
that it's a more effective optimization than a background vacuum
process.
>> 3. Reusing xact IDs would be nice, but there's an answer with a lot less
>> impact on the system: go to 8-byte xact IDs.
> +8 bytes in tuple header is not so tiny thing.
Agreed, but the people who need 8-byte IDs are not running small
installations. I think they'd sooner pay a little more in disk space
than risk costs in performance or reliability.
>> Another thought: do we need WAL UNDO at all to implement savepoints?
>> Is there some way we could do them like nested transactions, wherein
>> each savepoint-to-savepoint segment is given its own transaction number?
> Implicit savepoints wouldn't be possible - this is very convenient
> feature I've found in Oracle.
Why not? Seems to me that establishing implicit savepoints is just a
user-interface issue; you can do it, or not do it, regardless of the
underlying mechanism.
>> Implementing UNDO without creating lots of performance issues looks
>> a lot harder.
> What *performance* issues?!
> The only issue is additional disk requirements.
Not so. UNDO does failed-transaction cleanup work in the interactive
backends, where it necessarily delays clients who might otherwise be
issuing their next command. A VACUUM-based approach does the cleanup
work in the background. Same work, more or less, but it's not in the
clients' critical path.
BTW, UNDO for failed transactions alone will not eliminate the need for
VACUUM. Will you also make successful transactions go back and
physically remove the tuples they deleted?
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/users-lounge/docs/faq.html
From pgsql-hackers-owner+M9099@postgresql.org Sun May 20 17:09:01 2001
Return-path: <pgsql-hackers-owner+M9099@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4KL91N01322
for <pgman@candle.pha.pa.us>; Sun, 20 May 2001 17:09:01 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4KL7tA69488;
Sun, 20 May 2001 17:07:55 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9099@postgresql.org)
Received: from mailer.sectorbase.com (mailer.sectorbase.com [63.88.121.2])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4KL0qA67639
for <pgsql-hackers@postgresql.org>; Sun, 20 May 2001 17:00:52 -0400 (EDT)
(envelope-from vmikheev@sectorbase.com)
Received: (qmail 28135 invoked by uid 503); 20 May 2001 21:00:49 -0000
Received: from din3.sectorbase.com (HELO dune) (63.88.121.73)
by gate1.sectorbase.com with SMTP; 20 May 2001 21:00:49 -0000
Message-ID: <003701c0e16f$f3561ba0$4979583f@sectorbase.com>
From: "Vadim Mikheev" <vmikheev@sectorbase.com>
To: "Tom Lane" <tgl@sss.pgh.pa.us>
cc: "'Bruce Momjian'" <pgman@candle.pha.pa.us>, <pgsql-hackers@postgresql.org>
References: <3705826352029646A3E91C53F7189E3201662E@sectorbase2.sectorbase.com> <27745.990236257@sss.pgh.pa.us> <002d01c0e0f7$376b59a0$4c79583f@sectorbase.com> <12003.990378585@sss.pgh.pa.us>
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
Date: Sun, 20 May 2001 14:00:48 -0700
MIME-Version: 1.0
Content-Type: text/plain;
charset="windows-1251"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
> >> 1. Space reclamation via UNDO doesn't excite me a whole lot, if we can
> >> make lightweight VACUUM work well.
>
> > Sorry, but I'm going to consider background vacuum as temporary solution
> > only. As I've already pointed, original PG authors finally became
> > disillusioned with the same approach.
>
> How could they become disillusioned with it, when they never tried it?
> I know of no evidence that any version of PG has had backgroundable
> (non-blocking-to-other-transactions) VACUUM, still less within-relation
> space recycling. They may have become disillusioned with the form of
> VACUUM that they actually had (ie, the same one we've inherited) --- but
> please don't call that "the same approach" I'm proposing.
Pre-Postgres'95 (original) versions had vacuum daemon running in
background. I don't know if that vacuum shrinked relations or not
(there was no shrinking in '95 version), I know that daemon had to
do some extra work in moving old tuples to archival storage, but
anyway as you can read in old papers in the case of consistent heavy
load daemon was not able to cleanup storage fast enough. And the
reason is obvious - no matter how optimized your daemon will be
(in regard to blocking other transactions etc), it will have to
perform huge amount of IO just to find space available for reclaiming.
> Certainly, doing VACUUM this way is an experiment that may fail, or may
> require further work before it really works well. But I'd appreciate it
> if you wouldn't prejudge the results of the experiment.
Why not, Tom? Why shouldn't I say my opinion?
Last summer your comment about WAL, may experiment that time, was that
it will save just a few fsyncs. It was your right to make prejudment,
what's wrong with my rights? And you appealed to old papers as well, BTW.
> > Understandable, but why other transactions should read dirty data again
> > and again waiting for background vacuum? I think aborted transaction
> > should take some responsibility for mess made by them -:)
>
> They might read it again and again before the failed xact gets around to
> removing the data, too. You cannot rely on UNDO for correctness; at
> most it can be a speed/space optimization. I see no reason to assume
> that it's a more effective optimization than a background vacuum
> process.
Really?! Once again: WAL records give you *physical* address of tuples
(both heap and index ones!) to be removed and size of log to read
records from is not comparable with size of data files.
> >> Another thought: do we need WAL UNDO at all to implement savepoints?
> >> Is there some way we could do them like nested transactions, wherein
> >> each savepoint-to-savepoint segment is given its own transaction number?
>
> > Implicit savepoints wouldn't be possible - this is very convenient
> > feature I've found in Oracle.
>
> Why not? Seems to me that establishing implicit savepoints is just a
> user-interface issue; you can do it, or not do it, regardless of the
> underlying mechanism.
Implicit savepoints are setted by server automatically before each
query execution - you wouldn't use transaction IDs for this.
> >> Implementing UNDO without creating lots of performance issues looks
> >> a lot harder.
>
> > What *performance* issues?!
> > The only issue is additional disk requirements.
>
> Not so. UNDO does failed-transaction cleanup work in the interactive
> backends, where it necessarily delays clients who might otherwise be
> issuing their next command. A VACUUM-based approach does the cleanup
> work in the background. Same work, more or less, but it's not in the
> clients' critical path.
Not same work but much more and in the critical pathes of all clients.
And - is overall performance of Oracle or Informix worse then in PG?
Seems delays in clients for rollback doesn't affect performance so much.
But dirty storage does it.
> BTW, UNDO for failed transactions alone will not eliminate the need for
> VACUUM. Will you also make successful transactions go back and
> physically remove the tuples they deleted?
They can't do this, as you know pretty well. But using WAL to get TIDs to
be deleted is considerable, no?
Vadim
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?
http://www.postgresql.org/search.mpl
From vmikheev@sectorbase.com Sun May 20 17:13:42 2001
Return-path: <vmikheev@sectorbase.com>
Received: from mailer.sectorbase.com (mailer.sectorbase.com [63.88.121.2])
by candle.pha.pa.us (8.10.1/8.10.1) with SMTP id f4KLDfN01641
for <pgman@candle.pha.pa.us>; Sun, 20 May 2001 17:13:41 -0400 (EDT)
Received: (qmail 30876 invoked by uid 503); 20 May 2001 21:13:38 -0000
Received: from din3.sectorbase.com (HELO dune) (63.88.121.73)
by gate1.sectorbase.com with SMTP; 20 May 2001 21:13:38 -0000
Message-ID: <003f01c0e171$bd1e2f80$4979583f@sectorbase.com>
From: "Vadim Mikheev" <vmikheev@sectorbase.com>
To: "Bruce Momjian" <pgman@candle.pha.pa.us>, "Tom Lane" <tgl@sss.pgh.pa.us>
cc: <pgsql-hackers@postgresql.org>
References: <200105190357.f4J3v1h17419@candle.pha.pa.us>
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
Date: Sun, 20 May 2001 14:13:37 -0700
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
Status: OR
> Were you going to use WAL to get free space from old copies too?
Considerable approach.
> Vadim, I think I am missing something. You mentioned UNDO would be used
> for these cases and I don't understand the purpose of adding what would
> seem to be a pretty complex capability:
Yeh, we already won title of most advanced among simple databases, -:)
Yes, looking in list of IDs assigned to single transaction in tqual.c is much
easy to do than UNDO. As well as couple of fsyncs is easy than WAL.
> > 1. Reclaim space allocated by aborted transactions.
>
> Is there really a lot to be saved here vs. old tuples of committed
> transactions?
Are you able to protect COPY FROM from abort/crash?
Vadim
From pgsql-hackers-owner+M9103@postgresql.org Sun May 20 17:33:30 2001
Return-path: <pgsql-hackers-owner+M9103@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4KLXTN02284
for <pgman@candle.pha.pa.us>; Sun, 20 May 2001 17:33:29 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4KLX3A76360;
Sun, 20 May 2001 17:33:03 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9103@postgresql.org)
Received: from sss.pgh.pa.us (sss.pgh.pa.us [216.151.103.158])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4KLPuA74582
for <pgsql-hackers@postgresql.org>; Sun, 20 May 2001 17:25:56 -0400 (EDT)
(envelope-from tgl@sss.pgh.pa.us)
Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1])
by sss.pgh.pa.us (8.11.3/8.11.3) with ESMTP id f4KLPmR19773;
Sun, 20 May 2001 17:25:48 -0400 (EDT)
To: "Vadim Mikheev" <vmikheev@sectorbase.com>
cc: "'Bruce Momjian'" <pgman@candle.pha.pa.us>, pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
In-Reply-To: <003701c0e16f$f3561ba0$4979583f@sectorbase.com>
References: <3705826352029646A3E91C53F7189E3201662E@sectorbase2.sectorbase.com> <27745.990236257@sss.pgh.pa.us> <002d01c0e0f7$376b59a0$4c79583f@sectorbase.com> <12003.990378585@sss.pgh.pa.us> <003701c0e16f$f3561ba0$4979583f@sectorbase.com>
Comments: In-reply-to "Vadim Mikheev" <vmikheev@sectorbase.com>
message dated "Sun, 20 May 2001 14:00:48 -0700"
Date: Sun, 20 May 2001 17:25:47 -0400
Message-ID: <19770.990393947@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
"Vadim Mikheev" <vmikheev@sectorbase.com> writes:
> Really?! Once again: WAL records give you *physical* address of tuples
> (both heap and index ones!) to be removed and size of log to read
> records from is not comparable with size of data files.
You sure? With our current approach of dumping data pages into the WAL
on first change since checkpoint (and doing so again after each
checkpoint) it's not too difficult to devise scenarios where the WAL log
is *larger* than the affected datafiles ... and can't be truncated until
someone commits.
The copied-data-page traffic is the worst problem with our current
WAL implementation. I did some measurements last week on VACUUM of a
test table (the accounts table from a "pg_bench -s 10" setup, which
contains 1000000 rows; I updated 20000 rows and then vacuumed). This
generated about 34400 8k blocks of WAL traffic, of which about 33300
represented copied pages and the other 1100 blocks were actual WAL
entries. That's a pretty massive I/O overhead, considering the table
itself was under 20000 8k blocks. It was also interesting to note that
a large fraction of the CPU time was spent calculating CRCs on the WAL
data.
Would it be possible to split the WAL traffic into two sets of files,
one for WAL log records proper and one for copied pages? Seems like
we could recycle the pages after each checkpoint rather than hanging
onto them until the associated transactions commit.
>> Why not? Seems to me that establishing implicit savepoints is just a
>> user-interface issue; you can do it, or not do it, regardless of the
>> underlying mechanism.
> Implicit savepoints are setted by server automatically before each
> query execution - you wouldn't use transaction IDs for this.
If the user asked you to, I don't see why not.
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
From pgsql-hackers-owner+M9104@postgresql.org Sun May 20 17:37:15 2001
Return-path: <pgsql-hackers-owner+M9104@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4KLbFN02418
for <pgman@candle.pha.pa.us>; Sun, 20 May 2001 17:37:15 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4KLaZA77465;
Sun, 20 May 2001 17:36:35 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9104@postgresql.org)
Received: from mobile.hub.org (SHW39-29.accesscable.net [24.138.39.29])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4KLTRA75314
for <pgsql-hackers@postgresql.org>; Sun, 20 May 2001 17:29:27 -0400 (EDT)
(envelope-from scrappy@hub.org)
Received: from localhost (scrappy@localhost)
by mobile.hub.org (8.11.3/8.11.1) with ESMTP id f4KLT3640280;
Sun, 20 May 2001 18:29:03 -0300 (ADT)
(envelope-from scrappy@hub.org)
X-Authentication-Warning: mobile.hub.org: scrappy owned process doing -bs
Date: Sun, 20 May 2001 18:29:03 -0300 (ADT)
From: The Hermit Hacker <scrappy@hub.org>
To: Vadim Mikheev <vmikheev@sectorbase.com>
cc: Tom Lane <tgl@sss.pgh.pa.us>, "'Bruce Momjian'" <pgman@candle.pha.pa.us>,
<pgsql-hackers@postgresql.org>
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
In-Reply-To: <003701c0e16f$f3561ba0$4979583f@sectorbase.com>
Message-ID: <Pine.BSF.4.33.0105201826150.3057-100000@mobile.hub.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
On Sun, 20 May 2001, Vadim Mikheev wrote:
> > >> 1. Space reclamation via UNDO doesn't excite me a whole lot, if we can
> > >> make lightweight VACUUM work well.
> >
> > > Sorry, but I'm going to consider background vacuum as temporary solution
> > > only. As I've already pointed, original PG authors finally became
> > > disillusioned with the same approach.
> >
> > How could they become disillusioned with it, when they never tried it?
> > I know of no evidence that any version of PG has had backgroundable
> > (non-blocking-to-other-transactions) VACUUM, still less within-relation
> > space recycling. They may have become disillusioned with the form of
> > VACUUM that they actually had (ie, the same one we've inherited) --- but
> > please don't call that "the same approach" I'm proposing.
>
> Pre-Postgres'95 (original) versions had vacuum daemon running in
> background. I don't know if that vacuum shrinked relations or not
> (there was no shrinking in '95 version), I know that daemon had to
> do some extra work in moving old tuples to archival storage, but
> anyway as you can read in old papers in the case of consistent heavy
> load daemon was not able to cleanup storage fast enough. And the
> reason is obvious - no matter how optimized your daemon will be
> (in regard to blocking other transactions etc), it will have to
> perform huge amount of IO just to find space available for reclaiming.
>
> > Certainly, doing VACUUM this way is an experiment that may fail, or may
> > require further work before it really works well. But I'd appreciate it
> > if you wouldn't prejudge the results of the experiment.
>
> Why not, Tom? Why shouldn't I say my opinion?
> Last summer your comment about WAL, may experiment that time, was that
> it will save just a few fsyncs. It was your right to make prejudment,
> what's wrong with my rights? And you appealed to old papers as well, BTW.
If its an "experiment", shouldn't it be done outside of the main source
tree, with adequate testing in a high load situation, with a patch
released to the community for further testing/comments, before it is added
to the source tree? From reading Vadim's comment above (re:
pre-Postgres95), this daemonized approach would cause a high I/O load on
the server in a situation where there are *alot* of UPDATE/DELETEs
happening to the database, which should be easily recreatable, no? Or,
Vadim, am I misundertanding?
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly
From pgsql-hackers-owner+M9105@postgresql.org Sun May 20 18:05:07 2001
Return-path: <pgsql-hackers-owner+M9105@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4KM57N03461
for <pgman@candle.pha.pa.us>; Sun, 20 May 2001 18:05:07 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4KM4cA84495;
Sun, 20 May 2001 18:04:38 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9105@postgresql.org)
Received: from sss.pgh.pa.us (sss.pgh.pa.us [216.151.103.158])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4KLvQA82414
for <pgsql-hackers@postgresql.org>; Sun, 20 May 2001 17:57:26 -0400 (EDT)
(envelope-from tgl@sss.pgh.pa.us)
Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1])
by sss.pgh.pa.us (8.11.3/8.11.3) with ESMTP id f4KLvFR19989;
Sun, 20 May 2001 17:57:15 -0400 (EDT)
To: The Hermit Hacker <scrappy@hub.org>
cc: Vadim Mikheev <vmikheev@sectorbase.com>,
"'Bruce Momjian'" <pgman@candle.pha.pa.us>, pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
In-Reply-To: <Pine.BSF.4.33.0105201826150.3057-100000@mobile.hub.org>
References: <Pine.BSF.4.33.0105201826150.3057-100000@mobile.hub.org>
Comments: In-reply-to The Hermit Hacker <scrappy@hub.org>
message dated "Sun, 20 May 2001 18:29:03 -0300"
Date: Sun, 20 May 2001 17:57:15 -0400
Message-ID: <19986.990395835@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
The Hermit Hacker <scrappy@hub.org> writes:
> If its an "experiment", shouldn't it be done outside of the main source
> tree, with adequate testing in a high load situation, with a patch
> released to the community for further testing/comments, before it is added
> to the source tree?
Mebbe we should've handled WAL that way too ;-)
Seriously, I don't think that my proposed changes need be treated with
quite that much suspicion. The only part that is really intrusive is
the shared-memory free-heap-space-management change. But AFAICT that
will be a necessary component of *any* approach to getting rid of
VACUUM. We've been arguing here, in essence, about whether a background
or on-line approach to finding free space will be more useful; but that
still leaves you with the question of what you do with the free space
after you've found it. Without some kind of shared free space map,
there's not anything you can do except have the process that found the
space do tuple moving and file truncation --- ie, VACUUM. So even if
I'm quite wrong about the effectiveness of a background VACUUM, the FSM
code will still be needed: an UNDO-style approach is also going to need
an FSM to do anything with the free space it finds. It's equally clear
that the index AMs have to support index tuple deletion without
exclusive lock, or we'll still have blocking problems during free-space
cleanup, no matter what drives that cleanup. The only part of what
I've proposed that might end up getting relegated to the scrap heap is
the "lazy vacuum" command itself, which will be a self-contained and
relatively small module (smaller than the present commands/vacuum.c,
for sure).
Besides which, Vadim has already said that he won't have time to do
anything about space reclamation before 7.2. So even if background
vacuum does end up getting superseded by something better, we're going
to need it for a release or two ...
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/users-lounge/docs/faq.html
From pgsql-hackers-owner+M9110@postgresql.org Sun May 20 22:41:52 2001
Return-path: <pgsql-hackers-owner+M9110@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4L2fqN14617
for <pgman@candle.pha.pa.us>; Sun, 20 May 2001 22:41:52 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4L2YXA49590;
Sun, 20 May 2001 22:34:33 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9110@postgresql.org)
Received: from mailer.sectorbase.com (mailer.sectorbase.com [63.88.121.2])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4L2RAA47750
for <pgsql-hackers@postgresql.org>; Sun, 20 May 2001 22:27:10 -0400 (EDT)
(envelope-from vmikheev@sectorbase.com)
Received: (qmail 96761 invoked by uid 503); 21 May 2001 02:27:06 -0000
Received: from din2.sectorbase.com (HELO dune) (63.88.121.72)
by gate1.sectorbase.com with SMTP; 21 May 2001 02:27:06 -0000
Message-ID: <002b01c0e19d$88af9fa0$4879583f@sectorbase.com>
From: "Vadim Mikheev" <vmikheev@sectorbase.com>
To: "Tom Lane" <tgl@sss.pgh.pa.us>
cc: "'Bruce Momjian'" <pgman@candle.pha.pa.us>, <pgsql-hackers@postgresql.org>
References: <3705826352029646A3E91C53F7189E3201662E@sectorbase2.sectorbase.com> <27745.990236257@sss.pgh.pa.us> <002d01c0e0f7$376b59a0$4c79583f@sectorbase.com> <12003.990378585@sss.pgh.pa.us> <003701c0e16f$f3561ba0$4979583f@sectorbase.com> <19770.990393947@sss.pgh.pa.us>
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
Date: Sun, 20 May 2001 19:27:07 -0700
MIME-Version: 1.0
Content-Type: text/plain;
charset="windows-1251"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
> > Really?! Once again: WAL records give you *physical* address of tuples
> > (both heap and index ones!) to be removed and size of log to read
> > records from is not comparable with size of data files.
>
> You sure? With our current approach of dumping data pages into the WAL
> on first change since checkpoint (and doing so again after each
> checkpoint) it's not too difficult to devise scenarios where the WAL log
> is *larger* than the affected datafiles ... and can't be truncated until
> someone commits.
Yes, but note mine "size of log to read records from" - each log record
has pointer to previous record made by same transaction: rollback must
not read entire log file to get all records of specific transaction.
> >> Why not? Seems to me that establishing implicit savepoints is just a
> >> user-interface issue; you can do it, or not do it, regardless of the
> >> underlying mechanism.
>
> > Implicit savepoints are setted by server automatically before each
> > query execution - you wouldn't use transaction IDs for this.
>
> If the user asked you to, I don't see why not.
Example of one of implicit savepoint usage: skipping duplicate key insertion.
Using transaction IDs when someone want to insert a few thousand records?
Vadim
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly
From vmikheev@sectorbase.com Sun May 20 22:57:50 2001
Return-path: <vmikheev@sectorbase.com>
Received: from mailer.sectorbase.com (mailer.sectorbase.com [63.88.121.2])
by candle.pha.pa.us (8.10.1/8.10.1) with SMTP id f4L2voN15014
for <pgman@candle.pha.pa.us>; Sun, 20 May 2001 22:57:50 -0400 (EDT)
Received: (qmail 3400 invoked by uid 503); 21 May 2001 02:57:47 -0000
Received: from din2.sectorbase.com (HELO dune) (63.88.121.72)
by gate1.sectorbase.com with SMTP; 21 May 2001 02:57:47 -0000
Message-ID: <004301c0e1a1$d1e7fd80$4879583f@sectorbase.com>
From: "Vadim Mikheev" <vmikheev@sectorbase.com>
To: "The Hermit Hacker" <scrappy@hub.org>
cc: "Tom Lane" <tgl@sss.pgh.pa.us>, "'Bruce Momjian'" <pgman@candle.pha.pa.us>,
<pgsql-hackers@postgresql.org>
References: <Pine.BSF.4.33.0105201826150.3057-100000@mobile.hub.org>
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
Date: Sun, 20 May 2001 19:57:48 -0700
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
Status: OR
> If its an "experiment", shouldn't it be done outside of the main source
> tree, with adequate testing in a high load situation, with a patch
> released to the community for further testing/comments, before it is added
> to the source tree? From reading Vadim's comment above (re:
> pre-Postgres95), this daemonized approach would cause a high I/O load on
> the server in a situation where there are *alot* of UPDATE/DELETEs
> happening to the database, which should be easily recreatable, no? Or,
> Vadim, am I misundertanding?
It probably will not cause more IO than vacuum does right now.
But unfortunately it will not reduce that IO. Cleanup work will be spreaded
in time and users will not experience long lockouts but average impact
on overall system throughput will be same (or maybe higher).
My point is that we'll need in dynamic cleanup anyway and UNDO is
what should be implemented for dynamic cleanup of aborted changes.
Plus UNDO gives us natural implementation of savepoints and some
abilities in transaction IDs management, which we may use or not
(though, 4. - pg_log size management - is really good thing).
Vadim
From pgsql-hackers-owner+M9112@postgresql.org Sun May 20 23:14:28 2001
Return-path: <pgsql-hackers-owner+M9112@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4L3ESN15529
for <pgman@candle.pha.pa.us>; Sun, 20 May 2001 23:14:28 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4L3DcA60509;
Sun, 20 May 2001 23:13:38 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9112@postgresql.org)
Received: from mailer.sectorbase.com (mailer.sectorbase.com [63.88.121.2])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4L36IA58218
for <pgsql-hackers@postgresql.org>; Sun, 20 May 2001 23:06:19 -0400 (EDT)
(envelope-from vmikheev@sectorbase.com)
Received: (qmail 5139 invoked by uid 503); 21 May 2001 03:06:14 -0000
Received: from din2.sectorbase.com (HELO dune) (63.88.121.72)
by gate1.sectorbase.com with SMTP; 21 May 2001 03:06:14 -0000
Message-ID: <004f01c0e1a3$0024bb60$4879583f@sectorbase.com>
From: "Vadim Mikheev" <vmikheev@sectorbase.com>
To: "The Hermit Hacker" <scrappy@hub.org>, "Tom Lane" <tgl@sss.pgh.pa.us>
cc: "'Bruce Momjian'" <pgman@candle.pha.pa.us>, <pgsql-hackers@postgresql.org>
References: <Pine.BSF.4.33.0105201826150.3057-100000@mobile.hub.org> <19986.990395835@sss.pgh.pa.us>
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
Date: Sun, 20 May 2001 20:06:15 -0700
MIME-Version: 1.0
Content-Type: text/plain;
charset="windows-1251"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
> Seriously, I don't think that my proposed changes need be treated with
> quite that much suspicion. The only part that is really intrusive is
Agreed. I fight for UNDO, not against background vacuum -:)
> the shared-memory free-heap-space-management change. But AFAICT that
> will be a necessary component of *any* approach to getting rid of
> VACUUM. We've been arguing here, in essence, about whether a background
> or on-line approach to finding free space will be more useful; but that
> still leaves you with the question of what you do with the free space
> after you've found it. Without some kind of shared free space map,
> there's not anything you can do except have the process that found the
> space do tuple moving and file truncation --- ie, VACUUM. So even if
> I'm quite wrong about the effectiveness of a background VACUUM, the FSM
> code will still be needed: an UNDO-style approach is also going to need
> an FSM to do anything with the free space it finds. It's equally clear
Unfortunately, I think that we'll need in on-disk FSM and that FSM is
actually the most complex thing to do in "space reclamation" project.
> Besides which, Vadim has already said that he won't have time to do
> anything about space reclamation before 7.2. So even if background
> vacuum does end up getting superseded by something better, we're going
> to need it for a release or two ...
Yes.
Vadim
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
From pgsql-hackers-owner+M9113@postgresql.org Mon May 21 00:43:11 2001
Return-path: <pgsql-hackers-owner+M9113@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4L4hBN17985
for <pgman@candle.pha.pa.us>; Mon, 21 May 2001 00:43:11 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4L4gcA87748;
Mon, 21 May 2001 00:42:38 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9113@postgresql.org)
Received: from sss.pgh.pa.us (sss.pgh.pa.us [216.151.103.158])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4L4XCA84569
for <pgsql-hackers@postgresql.org>; Mon, 21 May 2001 00:33:12 -0400 (EDT)
(envelope-from tgl@sss.pgh.pa.us)
Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1])
by sss.pgh.pa.us (8.11.3/8.11.3) with ESMTP id f4L4WgR20824;
Mon, 21 May 2001 00:32:42 -0400 (EDT)
To: "Vadim Mikheev" <vmikheev@sectorbase.com>
cc: "The Hermit Hacker" <scrappy@hub.org>,
"'Bruce Momjian'" <pgman@candle.pha.pa.us>, pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
In-Reply-To: <004f01c0e1a3$0024bb60$4879583f@sectorbase.com>
References: <Pine.BSF.4.33.0105201826150.3057-100000@mobile.hub.org> <19986.990395835@sss.pgh.pa.us> <004f01c0e1a3$0024bb60$4879583f@sectorbase.com>
Comments: In-reply-to "Vadim Mikheev" <vmikheev@sectorbase.com>
message dated "Sun, 20 May 2001 20:06:15 -0700"
Date: Mon, 21 May 2001 00:32:42 -0400
Message-ID: <20821.990419562@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
"Vadim Mikheev" <vmikheev@sectorbase.com> writes:
> Unfortunately, I think that we'll need in on-disk FSM and that FSM is
> actually the most complex thing to do in "space reclamation" project.
I hope we can avoid on-disk FSM. Seems to me that that would create
problems both for performance (lots of extra disk I/O) and reliability
(what happens if FSM is corrupted? A restart won't fix it).
But, if we do need it, most of the work needed to install FSM APIs
should carry over. So I still don't see an objection to doing
in-memory FSM as a first step.
BTW, I was digging through the old Postgres papers this afternoon,
to refresh my memory about what they actually said about VACUUM.
I was interested to discover that at one time the tuple-insertion
algorithm went as follows:
1. Pick a page at random in the relation, read it in, and see if it
has enough free space. Repeat up to three times.
2. If #1 fails to find space, append tuple at end.
When they got around to doing some performance measurement, they
discovered that step #1 was a serious loser, and dropped it in favor
of pure #2 (which is what we still have today). Food for thought.
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly
From tgl@sss.pgh.pa.us Mon May 21 13:38:41 2001
Return-path: <tgl@sss.pgh.pa.us>
Received: from west.navpoint.com (root@west.navpoint.com [207.106.42.13])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4LHceQ02927
for <pgman@candle.pha.pa.us>; Mon, 21 May 2001 13:38:40 -0400 (EDT)
Received: from sss.pgh.pa.us (tgl@sss.pgh.pa.us [216.151.103.158])
by west.navpoint.com (8.11.3/8.10.1) with ESMTP id f4LE7uv21524
for <pgman@candle.pha.pa.us>; Mon, 21 May 2001 10:07:56 -0400 (EDT)
Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1])
by sss.pgh.pa.us (8.11.3/8.11.3) with ESMTP id f4LE6aR24899;
Mon, 21 May 2001 10:06:36 -0400 (EDT)
To: "Vadim Mikheev" <vmikheev@SECTORBASE.COM>
cc: "The Hermit Hacker" <scrappy@hub.org>,
"'Bruce Momjian'" <pgman@candle.pha.pa.us>, pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
In-Reply-To: <004301c0e1a1$d1e7fd80$4879583f@sectorbase.com>
References: <Pine.BSF.4.33.0105201826150.3057-100000@mobile.hub.org> <004301c0e1a1$d1e7fd80$4879583f@sectorbase.com>
Comments: In-reply-to "Vadim Mikheev" <vmikheev@sectorbase.com>
message dated "Sun, 20 May 2001 19:57:48 -0700"
Date: Mon, 21 May 2001 10:06:35 -0400
Message-ID: <24896.990453995@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
Status: OR
"Vadim Mikheev" <vmikheev@sectorbase.com> writes:
> It probably will not cause more IO than vacuum does right now.
> But unfortunately it will not reduce that IO.
Uh ... what? Certainly it will reduce the total cost of vacuum,
because it won't bother to try to move tuples to fill holes.
The index cleanup method I've proposed should be substantially
more efficient than the existing code, as well.
> My point is that we'll need in dynamic cleanup anyway and UNDO is
> what should be implemented for dynamic cleanup of aborted changes.
UNDO might offer some other benefits, but I doubt that it will allow
us to eliminate VACUUM completely. To do that, you would need to
keep track of free space using exact, persistent (on-disk) bookkeeping
data structures. The overhead of that will be very substantial: more,
I predict, than the approximate approach I proposed.
regards, tom lane
From pgsql-hackers-owner+M9138@postgresql.org Mon May 21 14:27:34 2001
Return-path: <pgsql-hackers-owner+M9138@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4LIRXQ09276
for <pgman@candle.pha.pa.us>; Mon, 21 May 2001 14:27:33 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4LIL7A94773;
Mon, 21 May 2001 14:21:07 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9138@postgresql.org)
Received: from mailer.sectorbase.com (mailer.sectorbase.com [63.88.121.2])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4LGWGA38768
for <pgsql-hackers@postgresql.org>; Mon, 21 May 2001 12:32:16 -0400 (EDT)
(envelope-from vmikheev@SECTORBASE.COM)
Received: (qmail 88093 invoked by uid 503); 21 May 2001 16:32:15 -0000
Received: from sectorbase2.sectorbase.com (192.168.254.2)
by gate1.sectorbase.com with SMTP; 21 May 2001 16:32:15 -0000
Received: by sectorbase2.sectorbase.com with Internet Mail Service (5.5.2653.19)
id <LG3CC5Q2>; Mon, 21 May 2001 09:31:16 -0700
Message-ID: <3705826352029646A3E91C53F7189E32016630@sectorbase2.sectorbase.com>
From: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>
To: "'Zeugswetter Andreas SB'" <ZeugswetterA@wien.spardat.at>,
Tom Lane
<tgl@sss.pgh.pa.us>
cc: "'Bruce Momjian'" <pgman@candle.pha.pa.us>, pgsql-hackers@postgresql.org
Subject: RE: [HACKERS] Plans for solving the VACUUM problem
Date: Mon, 21 May 2001 09:31:15 -0700
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
Content-Type: text/plain;
charset="windows-1251"
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
> > Really?! Once again: WAL records give you *physical*
> > address of tuples (both heap and index ones!) to be
> > removed and size of log to read records from is not
> > comparable with size of data files.
>
> So how about a background "vacuum like" process, that reads
> the WAL and does the cleanup ? Seems that would be great,
> since it then does not need to scan, and does not make
> forground cleanup necessary.
>
> Problem is when cleanup can not keep up with cleaning WAL
> files, that already want to be removed. I would envision a
> config, that sais how many Mb of WAL are allowed to queue
> up before clients are blocked.
Yes, some daemon could read logs and gather cleanup info.
We could activate it when switching to new log file segment
and synchronization with checkpointer is not big deal. That
daemon would also archive log files for WAL-based BAR,
if archiving is ON.
But this will be useful only with on-disk FSM.
Vadim
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly
From vmikheev@SECTORBASE.COM Mon May 21 13:36:13 2001
Return-path: <vmikheev@SECTORBASE.COM>
Received: from west.navpoint.com (root@west.navpoint.com [207.106.42.13])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4LHaDQ01995
for <pgman@candle.pha.pa.us>; Mon, 21 May 2001 13:36:13 -0400 (EDT)
Received: from mailer.sectorbase.com (mailer.sectorbase.com [63.88.121.2])
by west.navpoint.com (8.11.3/8.10.1) with SMTP id f4LGtfv12633
for <pgman@candle.pha.pa.us>; Mon, 21 May 2001 12:55:41 -0400 (EDT)
Received: (qmail 92843 invoked by uid 503); 21 May 2001 16:54:35 -0000
Received: from sectorbase2.sectorbase.com (192.168.254.2)
by gate1.sectorbase.com with SMTP; 21 May 2001 16:54:35 -0000
Received: by sectorbase2.sectorbase.com with Internet Mail Service (5.5.2653.19)
id <LG3CC5T2>; Mon, 21 May 2001 09:53:36 -0700
Message-ID: <3705826352029646A3E91C53F7189E32016631@sectorbase2.sectorbase.com>
From: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>
To: "'Tom Lane'" <tgl@sss.pgh.pa.us>
cc: The Hermit Hacker <scrappy@hub.org>,
"'Bruce Momjian'"
<pgman@candle.pha.pa.us>, pgsql-hackers@postgresql.org
Subject: RE: [HACKERS] Plans for solving the VACUUM problem
Date: Mon, 21 May 2001 09:53:35 -0700
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
Content-Type: text/plain;
charset="iso-8859-1"
Status: OR
> > It probably will not cause more IO than vacuum does right now.
> > But unfortunately it will not reduce that IO.
>
> Uh ... what? Certainly it will reduce the total cost of vacuum,
> because it won't bother to try to move tuples to fill holes.
Oh, you're right here, but daemon will most likely read data files
again and again with in-memory FSM. Also, if we'll do partial table
scans then we'll probably re-read indices > 1 time.
> The index cleanup method I've proposed should be substantially
> more efficient than the existing code, as well.
Not in IO area.
> > My point is that we'll need in dynamic cleanup anyway and UNDO is
> > what should be implemented for dynamic cleanup of aborted changes.
>
> UNDO might offer some other benefits, but I doubt that it will allow
> us to eliminate VACUUM completely. To do that, you would need to
I never told this -:)
> keep track of free space using exact, persistent (on-disk) bookkeeping
> data structures. The overhead of that will be very substantial: more,
> I predict, than the approximate approach I proposed.
I doubt that "big guys" use in-memory FSM. If they were able to do this...
Vadim
From pgsql-hackers-owner+M9136@postgresql.org Mon May 21 14:25:59 2001
Return-path: <pgsql-hackers-owner+M9136@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4LIPxQ09204
for <pgman@candle.pha.pa.us>; Mon, 21 May 2001 14:25:59 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4LIFbA91850;
Mon, 21 May 2001 14:15:37 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9136@postgresql.org)
Received: from mailer.sectorbase.com (mailer.sectorbase.com [63.88.121.2])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4LGueA52482
for <pgsql-hackers@postgresql.org>; Mon, 21 May 2001 12:56:40 -0400 (EDT)
(envelope-from vmikheev@SECTORBASE.COM)
Received: (qmail 93265 invoked by uid 503); 21 May 2001 16:56:39 -0000
Received: from sectorbase2.sectorbase.com (192.168.254.2)
by gate1.sectorbase.com with SMTP; 21 May 2001 16:56:39 -0000
Received: by sectorbase2.sectorbase.com with Internet Mail Service (5.5.2653.19)
id <LG3CC5TT>; Mon, 21 May 2001 09:55:40 -0700
Message-ID: <3705826352029646A3E91C53F7189E32016632@sectorbase2.sectorbase.com>
From: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>
To: "'Tom Lane'" <tgl@sss.pgh.pa.us>
cc: The Hermit Hacker <scrappy@hub.org>,
"'Bruce Momjian'"
<pgman@candle.pha.pa.us>, pgsql-hackers@postgresql.org
Subject: RE: [HACKERS] Plans for solving the VACUUM problem
Date: Mon, 21 May 2001 09:55:40 -0700
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
Content-Type: text/plain;
charset="iso-8859-1"
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
> I hope we can avoid on-disk FSM. Seems to me that that would create
> problems both for performance (lots of extra disk I/O) and reliability
> (what happens if FSM is corrupted? A restart won't fix it).
We can use WAL for FSM.
Vadim
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/users-lounge/docs/faq.html
From janwieck@Yahoo.com Mon May 21 13:36:06 2001
Return-path: <janwieck@Yahoo.com>
Received: from west.navpoint.com (root@west.navpoint.com [207.106.42.13])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4LHa6Q01945
for <pgman@candle.pha.pa.us>; Mon, 21 May 2001 13:36:06 -0400 (EDT)
Received: from smtp014.mail.yahoo.com (smtp014.mail.yahoo.com [216.136.173.58])
by west.navpoint.com (8.11.3/8.10.1) with SMTP id f4LHBuv17383
for <pgman@candle.pha.pa.us>; Mon, 21 May 2001 13:11:56 -0400 (EDT)
Received: from jupiter.us.greatbridge.com (HELO jupiter.jw.home) (65.196.69.55)
by smtp.mail.vip.sc5.yahoo.com with SMTP; 21 May 2001 17:10:55 -0000
X-Apparently-From: <janwieck@yahoo.com>
Received: (from janwieck@localhost)
by jupiter.jw.home (8.9.3/8.9.3) id NAA14283;
Mon, 21 May 2001 13:13:55 -0400
From: Jan Wieck <JanWieck@Yahoo.com>
Message-ID: <200105211713.NAA14283@jupiter.jw.home>
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
In-Reply-To: <20821.990419562@sss.pgh.pa.us> from Tom Lane at "May 21, 2001 00:32:42
am"
To: Tom Lane <tgl@sss.pgh.pa.us>
Date: Mon, 21 May 2001 13:13:55 -0400 (EDT)
cc: Vadim Mikheev <vmikheev@SECTORBASE.COM>,
The Hermit Hacker <scrappy@hub.org>,
"'Bruce Momjian'" <pgman@candle.pha.pa.us>,
pgsql-hackers@postgresql.orgrg.us.greatbridge.com
X-Mailer: ELM [version 2.4ME+ PL68 (25)]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Status: OR
Tom Lane wrote:
> "Vadim Mikheev" <vmikheev@sectorbase.com> writes:
> > Unfortunately, I think that we'll need in on-disk FSM and that FSM is
> > actually the most complex thing to do in "space reclamation" project.
>
> I hope we can avoid on-disk FSM. Seems to me that that would create
> problems both for performance (lots of extra disk I/O) and reliability
> (what happens if FSM is corrupted? A restart won't fix it).
>
> But, if we do need it, most of the work needed to install FSM APIs
> should carry over. So I still don't see an objection to doing
> in-memory FSM as a first step.
>
>
> BTW, I was digging through the old Postgres papers this afternoon,
> to refresh my memory about what they actually said about VACUUM.
> I was interested to discover that at one time the tuple-insertion
> algorithm went as follows:
> 1. Pick a page at random in the relation, read it in, and see if it
> has enough free space. Repeat up to three times.
> 2. If #1 fails to find space, append tuple at end.
> When they got around to doing some performance measurement, they
> discovered that step #1 was a serious loser, and dropped it in favor
> of pure #2 (which is what we still have today). Food for thought.
No surprise to me, because without removing dead tuples (plus
their index entries) and compacting pages, there's VERY
unlikely freespace on a randomly selected page. And AFAIR
these steps haven't been done by those versions.
I think the in-shared-mem FSM could have some max-per-table
limit and the background VACUUM just skips the entire table
as long as nobody reused any space. Also it might only
compact pages that lead to 25 or more percent of freespace in
the first place. That makes it more likely that if someone
looks for a place to store a tuple that it'll fit into that
block (remember that the toaster tries to keep main tuples
below BLKSZ/4).
Jan
--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck@Yahoo.com #
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
From vmikheev@SECTORBASE.COM Mon May 21 13:36:05 2001
Return-path: <vmikheev@SECTORBASE.COM>
Received: from west.navpoint.com (root@west.navpoint.com [207.106.42.13])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4LHa5Q01929
for <pgman@candle.pha.pa.us>; Mon, 21 May 2001 13:36:05 -0400 (EDT)
Received: from mailer.sectorbase.com (mailer.sectorbase.com [63.88.121.2])
by west.navpoint.com (8.11.3/8.10.1) with SMTP id f4LHNtv21125
for <pgman@candle.pha.pa.us>; Mon, 21 May 2001 13:23:55 -0400 (EDT)
Received: (qmail 3362 invoked by uid 503); 21 May 2001 17:23:50 -0000
Received: from sectorbase2.sectorbase.com (192.168.254.2)
by gate1.sectorbase.com with SMTP; 21 May 2001 17:23:50 -0000
Received: by sectorbase2.sectorbase.com with Internet Mail Service (5.5.2653.19)
id <LG3CC5WP>; Mon, 21 May 2001 10:22:50 -0700
Message-ID: <3705826352029646A3E91C53F7189E32016634@sectorbase2.sectorbase.com>
From: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>
To: "'Jan Wieck'" <JanWieck@Yahoo.com>, Tom Lane <tgl@sss.pgh.pa.us>
cc: The Hermit Hacker <scrappy@hub.org>,
"'Bruce Momjian'"
<pgman@candle.pha.pa.us>,
pgsql-hackers@postgresql.orgrg.us.greatbridge.com
Subject: RE: [HACKERS] Plans for solving the VACUUM problem
Date: Mon, 21 May 2001 10:22:49 -0700
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
Content-Type: text/plain;
charset="iso-8859-1"
Status: OR
> I think the in-shared-mem FSM could have some max-per-table
> limit and the background VACUUM just skips the entire table
> as long as nobody reused any space. Also it might only
> compact pages that lead to 25 or more percent of freespace in
> the first place. That makes it more likely that if someone
> looks for a place to store a tuple that it'll fit into that
> block (remember that the toaster tries to keep main tuples
> below BLKSZ/4).
This should be configurable parameter like PCFREE (or something
like that) in Oracle: consider page for insertion only if it's
PCFREE % empty.
Vadim
From pgsql-hackers-owner+M9142@postgresql.org Mon May 21 16:02:27 2001
Return-path: <pgsql-hackers-owner+M9142@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4LK2QQ21180
for <pgman@candle.pha.pa.us>; Mon, 21 May 2001 16:02:26 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4LItoA12128;
Mon, 21 May 2001 14:55:50 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9142@postgresql.org)
Received: from sss.pgh.pa.us (sss.pgh.pa.us [216.151.103.158])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4LHN2A66016
for <pgsql-hackers@postgreSQL.org>; Mon, 21 May 2001 13:23:02 -0400 (EDT)
(envelope-from tgl@sss.pgh.pa.us)
Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1])
by sss.pgh.pa.us (8.11.3/8.11.3) with ESMTP id f4LHMrR29288;
Mon, 21 May 2001 13:22:53 -0400 (EDT)
To: Jan Wieck <JanWieck@yahoo.com>
cc: Vadim Mikheev <vmikheev@sectorbase.com>, pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
In-Reply-To: <200105211713.NAA14283@jupiter.jw.home>
References: <200105211713.NAA14283@jupiter.jw.home>
Comments: In-reply-to Jan Wieck <JanWieck@yahoo.com>
message dated "Mon, 21 May 2001 13:13:55 -0400"
Date: Mon, 21 May 2001 13:22:53 -0400
Message-ID: <29285.990465773@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
Jan Wieck <JanWieck@yahoo.com> writes:
> I think the in-shared-mem FSM could have some max-per-table
> limit and the background VACUUM just skips the entire table
> as long as nobody reused any space.
I was toying with the notion of trying to use Vadim's "MNMB" idea
(see his description of the work he did for Perlstein last year);
that is, keep track of the lowest block number of any modified block
within each relation since the last VACUUM. Then VACUUM would only
have to scan from there to the end. This covers the totally-untouched-
relation case nicely, and also helps a lot for large rels that you're
mostly just adding to or perhaps updating recent additions.
The FSM could probably keep track of such info fairly easily, since
it will already be aware of which blocks it's told backends to try
to insert into. But it would have to be told about deletes too,
which would mean more FSM access traffic and more lock contention.
Another problem (given my current view of how FSM should work) is that
rels not being used at all would not be in FSM, or would age out of it,
and so you wouldn't know that you didn't need to vacuum them.
So I'm not sure yet if it's a good idea.
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
From pgsql-hackers-owner+M9141@postgresql.org Mon May 21 14:55:40 2001
Return-path: <pgsql-hackers-owner+M9141@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4LItdQ12873
for <pgman@candle.pha.pa.us>; Mon, 21 May 2001 14:55:39 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4LIrgA10844;
Mon, 21 May 2001 14:53:42 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9141@postgresql.org)
Received: from mailer.sectorbase.com (mailer.sectorbase.com [63.88.121.2])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4LHrUA80109
for <pgsql-hackers@postgreSQL.org>; Mon, 21 May 2001 13:53:30 -0400 (EDT)
(envelope-from vmikheev@SECTORBASE.COM)
Received: (qmail 9854 invoked by uid 503); 21 May 2001 17:53:29 -0000
Received: from sectorbase2.sectorbase.com (192.168.254.2)
by gate1.sectorbase.com with SMTP; 21 May 2001 17:53:29 -0000
Received: by sectorbase2.sectorbase.com with Internet Mail Service (5.5.2653.19)
id <LG3CC5Z0>; Mon, 21 May 2001 10:52:29 -0700
Message-ID: <3705826352029646A3E91C53F7189E32016636@sectorbase2.sectorbase.com>
From: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>
To: "'Tom Lane'" <tgl@sss.pgh.pa.us>
cc: pgsql-hackers@postgresql.org
Subject: RE: [HACKERS] Plans for solving the VACUUM problem
Date: Mon, 21 May 2001 10:52:28 -0700
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
Content-Type: text/plain;
charset="iso-8859-1"
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
> > We could keep share buffer lock (or add some other kind of lock)
> > untill tuple projected - after projection we need not to read data
> > for fetched tuple from shared buffer and time between fetching
> > tuple and projection is very short, so keeping lock on buffer will
> > not impact concurrency significantly.
>
> Or drop the pin on the buffer to show we no longer have a pointer to it.
This is not good for seqscans which will return to that buffer anyway.
> > Or we could register callback cleanup function with buffer so bufmgr
> > would call it when refcnt drops to 0.
>
> Hmm ... might work. There's no guarantee that the refcnt
> would drop to zero before the current backend exits, however.
> Perhaps set a flag in the shared buffer header, and the last guy
> to drop his pin is supposed to do the cleanup?
This is what I've meant - set (register) some pointer in buffer header
to cleanup function.
> But then you'd be pushing VACUUM's work into productive transactions,
> which is probably not the way to go.
Not big work - I wouldn't worry about it.
> > Two ways: hold index page lock untill heap tuple is checked
> > or (rough schema) store info in shmem (just IndexTupleData.t_tid
> > and flag) that an index tuple is used by some scan so cleaner could
> > change stored TID (get one from prev index tuple) and set flag to
> > help scan restore its current position on return.
>
> Another way is to mark the index tuple "gone but not forgotten", so to
> speak --- mark it dead without removing it. (We could know that we need
> to do that if we see someone else has a buffer pin on the index page.)
Register cleanup function just like with heap above.
> None of these seem real clean though. Needs more thought.
Vadim
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?
http://www.postgresql.org/search.mpl
From vmikheev@SECTORBASE.COM Mon May 21 14:02:52 2001
Return-path: <vmikheev@SECTORBASE.COM>
Received: from west.navpoint.com (root@west.navpoint.com [207.106.42.13])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4LI2pQ07495
for <pgman@candle.pha.pa.us>; Mon, 21 May 2001 14:02:51 -0400 (EDT)
Received: from mailer.sectorbase.com (mailer.sectorbase.com [63.88.121.2])
by west.navpoint.com (8.11.3/8.10.1) with SMTP id f4LI2ov03000
for <pgman@candle.pha.pa.us>; Mon, 21 May 2001 14:02:50 -0400 (EDT)
Received: (qmail 11793 invoked by uid 503); 21 May 2001 18:02:45 -0000
Received: from sectorbase2.sectorbase.com (192.168.254.2)
by gate1.sectorbase.com with SMTP; 21 May 2001 18:02:45 -0000
Received: by sectorbase2.sectorbase.com with Internet Mail Service (5.5.2653.19)
id <LG3CC555>; Mon, 21 May 2001 11:01:45 -0700
Message-ID: <3705826352029646A3E91C53F7189E32016637@sectorbase2.sectorbase.com>
From: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>
To: "'Zeugswetter Andreas SB'" <ZeugswetterA@wien.spardat.at>,
The Hermit Hacker <scrappy@hub.org>
cc: Tom Lane <tgl@sss.pgh.pa.us>, "'Bruce Momjian'" <pgman@candle.pha.pa.us>,
pgsql-hackers@postgresql.org
Subject: RE: [HACKERS] Plans for solving the VACUUM problem
Date: Mon, 21 May 2001 11:01:45 -0700
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
Content-Type: text/plain;
charset="iso-8859-1"
Status: ORr
> > My point is that we'll need in dynamic cleanup anyway and UNDO is
> > what should be implemented for dynamic cleanup of aborted changes.
>
> I do not yet understand why you want to handle aborts different than
> outdated tuples.
Maybe because of aborted tuples have shorter Time-To-Live.
And probability to find pages for them in buffer pool is higher.
> The ratio in a well tuned system should well favor outdated tuples.
> If someone ever adds "dirty read" it is also not the case that it
> is guaranteed, that nobody accesses the tuple you currently want
> to undo. So I really miss to see the big difference.
It will not be guaranteed anyway as soon as we start removing
tuples without exclusive access to relation.
And, I cannot say that I would implement UNDO because of
1. (cleanup) OR 2. (savepoints) OR 4. (pg_log management)
but because of ALL of 1., 2., 4.
Vadim
From pgsql-hackers-owner+M9152@postgresql.org Mon May 21 16:18:57 2001
Return-path: <pgsql-hackers-owner+M9152@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4LKIvQ21799
for <pgman@candle.pha.pa.us>; Mon, 21 May 2001 16:18:57 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4LKBqA45520;
Mon, 21 May 2001 16:11:52 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9152@postgresql.org)
Received: from mailer.sectorbase.com (mailer.sectorbase.com [63.88.121.2])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4LK2VA42041
for <pgsql-hackers@postgreSQL.org>; Mon, 21 May 2001 16:02:31 -0400 (EDT)
(envelope-from vmikheev@SECTORBASE.COM)
Received: (qmail 59448 invoked by uid 503); 21 May 2001 20:02:29 -0000
Received: from sectorbase2.sectorbase.com (192.168.254.2)
by gate1.sectorbase.com with SMTP; 21 May 2001 20:02:29 -0000
Received: by sectorbase2.sectorbase.com with Internet Mail Service (5.5.2653.19)
id <LG3CC6HP>; Mon, 21 May 2001 13:01:29 -0700
Message-ID: <3705826352029646A3E91C53F7189E3201663A@sectorbase2.sectorbase.com>
From: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>
To: "'Tom Lane'" <tgl@sss.pgh.pa.us>
cc: pgsql-hackers@postgresql.org
Subject: RE: [HACKERS] Plans for solving the VACUUM problem
Date: Mon, 21 May 2001 13:01:29 -0700
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
Content-Type: text/plain;
charset="iso-8859-1"
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
> > We could keep share buffer lock (or add some other kind of lock)
> > untill tuple projected - after projection we need not to read data
> > for fetched tuple from shared buffer and time between fetching
> > tuple and projection is very short, so keeping lock on buffer will
> > not impact concurrency significantly.
>
> Or drop the pin on the buffer to show we no longer have a pointer
> to it. I'm not sure that the time to do projection is short though
> --- what if there are arbitrary user-defined functions in the quals
> or the projection targetlist?
Well, while we are on this subject I finally should say about issue
bothered me for long time: only "simple" functions should be allowed
to deal with data in shared buffers directly. "Simple" means: no SQL
queries there. Why? One reason: we hold shlock on buffer while doing
seqscan qual - what if qual' SQL queries will try to acquire exclock
on the same buffer? Another reason - concurrency. I think that such
"heavy" functions should be provided with copy of data.
Vadim
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly
From pgsql-hackers-owner+M9160@postgresql.org Mon May 21 20:38:44 2001
Return-path: <pgsql-hackers-owner+M9160@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4M0chQ18986
for <pgman@candle.pha.pa.us>; Mon, 21 May 2001 20:38:43 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4M0OoA26618;
Mon, 21 May 2001 20:24:50 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9160@postgresql.org)
Received: from ns.sharemation.com (h-64-105-36-191.snvacaid.covad.net [64.105.36.191])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4M0JcA24979
for <pgsql-hackers@postgresql.org>; Mon, 21 May 2001 20:19:38 -0400 (EDT)
(envelope-from barry@xythos.com)
Received: from xythos.com ([192.168.254.19])
by ns.sharemation.com (8.9.3/8.8.7) with ESMTP id QAA03121
for <pgsql-hackers@postgresql.org>; Mon, 21 May 2001 16:04:21 -0700
Message-ID: <3B09B04A.5060806@xythos.com>
Date: Mon, 21 May 2001 17:18:18 -0700
From: Barry Lind <barry@xythos.com>
User-Agent: Mozilla/5.0 (X11; U; Linux 2.2.16-22 i686; en-US; m18) Gecko/20010131 Netscape6/6.01
X-Accept-Language: en
MIME-Version: 1.0
To: pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
References: <3705826352029646A3E91C53F7189E3201662E@sectorbase2.sectorbase.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
Mikheev, Vadim wrote:
>
> Ok, last reminder -:))
>
> On transaction abort, read WAL records and undo (rollback)
> changes made in storage. Would allow:
>
> 1. Reclaim space allocated by aborted transactions.
> 2. Implement SAVEPOINTs.
> Just to remind -:) - in the event of error discovered by server
> - duplicate key, deadlock, command mistyping, etc, - transaction
> will be rolled back to the nearest implicit savepoint setted
> just before query execution; - or transaction can be aborted by
> ROLLBACK TO <savepoint_name> command to some explicit savepoint
> setted by user. Transaction rolled back to savepoint may be continued.
> 3. Reuse transaction IDs on postmaster restart.
> 4. Split pg_log into small files with ability to remove old ones (which
> do not hold statuses for any running transactions).
>
> Vadim
This is probably not a good thread to add my two cents worth, but here
goes anyway.
The biggest issue I see with the proposed UNDO using WAL is the issue of
large/long lasting transactions. While it might be possible to solve
this problem with some extra work. However keep in mind that different
types of transactions (i.e. normal vs bulk loads) require different
amounts of time and/or UNDO. To solve this problem, you really need per
transaction limits which seems difficult to implement.
I have no doubt that UNDO with WAL can be done. But is there some other
way of doing UNDO that might be just as good or better?
Part of what I see in this thread reading between the lines is that some
believe the solution to many problems in the long term is to implement
an overwriting storage manager. Implementing UNDO via WAL is a
necessary step in that direction. While others seem to believe that the
non-overwriting storage manager has some life in it yet, and may even be
the storage manager for many releases to come. I don't know enough
about the internals to have any say in that discussion, however the
grass isn't always greener on the other side of the fence (i.e. an
overwriting storage manager will come with its own set of problems/issues).
So let me throw out an idea for UNDO using the current storage manager.
First let me state that UNDO is a bit of a misnomer, since undo for
transactions is already implemented. That is what pg_log is all about.
The part of UNDO that is missing is savepoints (either explicit or
implicit), because pg_log doesn't capture the information for each
command in a transaction. So the question really becomes, how to
implement savepoints with current storage manager?
I am going to lay out one assumption that I am making:
1) Most transactions are either completely successful or completely
rolled back
(If this weren't true, i.e. you really needed savepoints to partially
rollback changes, you couldn't be using the existing version of
postgresql at all)
My proposal is:
1) create a new relation to store 'failed commands' for transactions.
This is similar to pg_log for transactions, but takes it to the
command level. And since it records only failed commands (or ranges of
failed commands), thus most transactions will not have any information
in this relation per the assumption above.
2) Use the unused pg_log status (3 = unused, 2 = commit, 1 = abort, 0
= inprocess) to mean that the transaction was commited but some commands
were rolled back (i.e. partial commit)
Again for the majority of transactions nothing will need to change,
since they will still be marked as committed or aborted.
3) Code that determines whether or not a tuple is committed or not
needs to be aware of this new pg_log status, and look in the new
relation to see if the particular command was rolled back or not to
determine the commited status of the tuple. This subtly changes the
meaning of HEAP_XMIN_COMMITTED and related flags to reflect the
transaction and command status instead of just the transaction status.
The runtime cost of this shouldn't be too high, since the committed
state is cached in HEAP_XMIN_COMMITTED et al, it is only the added cost
for the pass that needs to set these flags, and then there is only added
cost in the case that the transaction wasn't completely sucessful (again
my assumption above).
Now I have know idea if what I am proposing is really doable or not. I
am just throwing this out as an alternative to WAL based
UNDO/savepoints. The reason I am doing this is that to me it seems to
leverage much of the existing infrastructure already in place that
performs undo for rolledback transactions (all the tmin, tmax, cmin,
cmax stuff as well as vacuum). Also it doesn't come with the large WAL
log file problem for large transactions.
Now having said all of this I realize that this doesn't solve the 4
billion transaction id limit problem, or the large size of the pg_log
file with large numbers of transactions.
thanks,
--Barry
>
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
From pgsql-hackers-owner+M9208@postgresql.org Tue May 22 14:02:04 2001
Return-path: <pgsql-hackers-owner+M9208@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4MI23Q13398
for <pgman@candle.pha.pa.us>; Tue, 22 May 2001 14:02:03 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4MI1OA96629;
Tue, 22 May 2001 14:01:24 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9208@postgresql.org)
Received: from candle.pha.pa.us (candle.navpoint.com [162.33.245.46])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4MHY9A84049
for <pgsql-hackers@postgresql.org>; Tue, 22 May 2001 13:34:09 -0400 (EDT)
(envelope-from pgman@candle.pha.pa.us)
Received: (from pgman@localhost)
by candle.pha.pa.us (8.10.1/8.10.1) id f4MHWef08905;
Tue, 22 May 2001 13:32:40 -0400 (EDT)
From: Bruce Momjian <pgman@candle.pha.pa.us>
Message-ID: <200105221732.f4MHWef08905@candle.pha.pa.us>
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
In-Reply-To: <3705826352029646A3E91C53F7189E32016637@sectorbase2.sectorbase.com>
"from Mikheev, Vadim at May 21, 2001 11:01:45 am"
To: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>
Date: Tue, 22 May 2001 13:32:40 -0400 (EDT)
cc: "'Zeugswetter Andreas SB'" <ZeugswetterA@wien.spardat.at>,
The Hermit Hacker <scrappy@hub.org>, Tom Lane <tgl@sss.pgh.pa.us>,
pgsql-hackers@postgresql.org
X-Mailer: ELM [version 2.4ME+ PL90 (25)]
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
[ Charset ISO-8859-1 unsupported, converting... ]
> > > My point is that we'll need in dynamic cleanup anyway and UNDO is
> > > what should be implemented for dynamic cleanup of aborted changes.
> >
> > I do not yet understand why you want to handle aborts different than
> > outdated tuples.
>
> Maybe because of aborted tuples have shorter Time-To-Live.
> And probability to find pages for them in buffer pool is higher.
This brings up an idea I had about auto-vacuum. I wonder if autovacuum
could do most of its work by looking at the buffer cache pages and
commit xids. Seems it would be quite easy record freespace in pages
already in the buffer and collect that information for other backends to
use. It could also move tuples between cache pages with little
overhead.
There wouldn't be an I/O overhead, and frequently used tables are
already in the cache.
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
From pgsql-hackers-owner+M9209@postgresql.org Tue May 22 14:42:27 2001
Return-path: <pgsql-hackers-owner+M9209@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4MIgRQ16770
for <pgman@candle.pha.pa.us>; Tue, 22 May 2001 14:42:27 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4MIfcA15426;
Tue, 22 May 2001 14:41:38 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9209@postgresql.org)
Received: from candle.pha.pa.us (candle.navpoint.com [162.33.245.46])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4MHmdA90489
for <pgsql-hackers@postgresql.org>; Tue, 22 May 2001 13:48:39 -0400 (EDT)
(envelope-from pgman@candle.pha.pa.us)
Received: (from pgman@localhost)
by candle.pha.pa.us (8.10.1/8.10.1) id f4MHlF409586;
Tue, 22 May 2001 13:47:15 -0400 (EDT)
From: Bruce Momjian <pgman@candle.pha.pa.us>
Message-ID: <200105221747.f4MHlF409586@candle.pha.pa.us>
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
In-Reply-To: <3705826352029646A3E91C53F7189E32016637@sectorbase2.sectorbase.com>
"from Mikheev, Vadim at May 21, 2001 11:01:45 am"
To: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>
Date: Tue, 22 May 2001 13:47:15 -0400 (EDT)
cc: "'Zeugswetter Andreas SB'" <ZeugswetterA@wien.spardat.at>,
The Hermit Hacker <scrappy@hub.org>, Tom Lane <tgl@sss.pgh.pa.us>,
pgsql-hackers@postgresql.org
X-Mailer: ELM [version 2.4ME+ PL90 (25)]
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
> > The ratio in a well tuned system should well favor outdated tuples.
> > If someone ever adds "dirty read" it is also not the case that it
> > is guaranteed, that nobody accesses the tuple you currently want
> > to undo. So I really miss to see the big difference.
>
> It will not be guaranteed anyway as soon as we start removing
> tuples without exclusive access to relation.
>
> And, I cannot say that I would implement UNDO because of
> 1. (cleanup) OR 2. (savepoints) OR 4. (pg_log management)
> but because of ALL of 1., 2., 4.
OK, I understand your reasoning here, but I want to make a comment.
Looking at the previous features you added, like subqueries, MVCC, or
WAL, these were major features that greatly enhanced the system's
capabilities.
Now, looking at UNDO, I just don't see it in the same league as those
other additions. Of course, you can work on whatever you want, but I
was hoping to see another major feature addition for 7.2. We know we
badly need auto-vacuum, improved replication, and point-in-time recover.
I can see UNDO improving row reuse, and making subtransactions and
pg_log compression easier, but these items do not require UNDO.
In fact, I am unsure why we would want an UNDO way of reusing rows of
aborted transactions and an autovacuum way of reusing rows from
committed transactions, expecially because aborted transactions account
for <5% of all transactions. It would be better to put work into one
mechanism that would reuse all tuples.
If UNDO came with no limitations, it may be a good option, but the need
to carry tuples until transaction commit does add an extra burden on
programmers and administrators, and I just don't see what we are getting
for it.
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly
From pgsql-hackers-owner+M9227@postgresql.org Tue May 22 18:03:59 2001
Return-path: <pgsql-hackers-owner+M9227@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4MM3xQ20269
for <pgman@candle.pha.pa.us>; Tue, 22 May 2001 18:03:59 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4MM3PA02618;
Tue, 22 May 2001 18:03:25 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9227@postgresql.org)
Received: from mailer.sectorbase.com (mailer.sectorbase.com [63.88.121.2])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4MLZAA93186
for <pgsql-hackers@postgresql.org>; Tue, 22 May 2001 17:35:10 -0400 (EDT)
(envelope-from vmikheev@SECTORBASE.COM)
Received: (qmail 96775 invoked by uid 503); 22 May 2001 21:34:46 -0000
Received: from sectorbase2.sectorbase.com (192.168.254.2)
by gate1.sectorbase.com with SMTP; 22 May 2001 21:34:46 -0000
Received: by sectorbase2.sectorbase.com with Internet Mail Service (5.5.2653.19)
id <LG3CC0J8>; Tue, 22 May 2001 14:33:43 -0700
Message-ID: <3705826352029646A3E91C53F7189E32016648@sectorbase2.sectorbase.com>
From: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>
To: "'Bruce Momjian'" <pgman@candle.pha.pa.us>
cc: "'Zeugswetter Andreas SB'" <ZeugswetterA@wien.spardat.at>,
The Hermit Hacker <scrappy@hub.org>, Tom Lane <tgl@sss.pgh.pa.us>,
pgsql-hackers@postgresql.org
Subject: RE: [HACKERS] Plans for solving the VACUUM problem
Date: Tue, 22 May 2001 14:33:38 -0700
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
Content-Type: text/plain;
charset="iso-8859-1"
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
> > And, I cannot say that I would implement UNDO because of
> > 1. (cleanup) OR 2. (savepoints) OR 4. (pg_log management)
> > but because of ALL of 1., 2., 4.
>
> OK, I understand your reasoning here, but I want to make a comment.
>
> Looking at the previous features you added, like subqueries, MVCC, or
> WAL, these were major features that greatly enhanced the system's
> capabilities.
>
> Now, looking at UNDO, I just don't see it in the same league as those
> other additions. Of course, you can work on whatever you want, but I
> was hoping to see another major feature addition for 7.2. We know we
> badly need auto-vacuum, improved replication, and point-in-time recover.
I don't like auto-vacuum approach in long term, WAL-based BAR is too easy
to do -:) (and you know that there is man who will do it, probably),
bidirectional sync replication is good to work on, but I'm more
interested in storage/transaction management now. And I'm not sure
if I'll have enough time for "another major feature in 7.2" anyway.
> It would be better to put work into one mechanism that would
> reuse all tuples.
This is what we're discussing now -:)
If community will not like UNDO then I'll probably try to implement
dead space collector which will read log files and so on. Easy to
#ifdef it in 7.2 to use in 7.3 (or so) with on-disk FSM. Also, I have
to implement logging for non-btree indices (anyway required for UNDO,
WAL-based BAR, WAL-based space reusing).
Vadim
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly
From vmikheev@SECTORBASE.COM Tue May 22 17:34:52 2001
Return-path: <vmikheev@SECTORBASE.COM>
Received: from mailer.sectorbase.com (mailer.sectorbase.com [63.88.121.2])
by candle.pha.pa.us (8.10.1/8.10.1) with SMTP id f4MLYpQ17853
for <pgman@candle.pha.pa.us>; Tue, 22 May 2001 17:34:51 -0400 (EDT)
Received: (qmail 96775 invoked by uid 503); 22 May 2001 21:34:46 -0000
Received: from sectorbase2.sectorbase.com (192.168.254.2)
by gate1.sectorbase.com with SMTP; 22 May 2001 21:34:46 -0000
Received: by sectorbase2.sectorbase.com with Internet Mail Service (5.5.2653.19)
id <LG3CC0J8>; Tue, 22 May 2001 14:33:43 -0700
Message-ID: <3705826352029646A3E91C53F7189E32016648@sectorbase2.sectorbase.com>
From: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>
To: "'Bruce Momjian'" <pgman@candle.pha.pa.us>
cc: "'Zeugswetter Andreas SB'" <ZeugswetterA@wien.spardat.at>,
The Hermit Hacker <scrappy@hub.org>, Tom Lane <tgl@sss.pgh.pa.us>,
pgsql-hackers@postgresql.org
Subject: RE: [HACKERS] Plans for solving the VACUUM problem
Date: Tue, 22 May 2001 14:33:38 -0700
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
Content-Type: text/plain;
charset="iso-8859-1"
Status: OR
> > And, I cannot say that I would implement UNDO because of
> > 1. (cleanup) OR 2. (savepoints) OR 4. (pg_log management)
> > but because of ALL of 1., 2., 4.
>
> OK, I understand your reasoning here, but I want to make a comment.
>
> Looking at the previous features you added, like subqueries, MVCC, or
> WAL, these were major features that greatly enhanced the system's
> capabilities.
>
> Now, looking at UNDO, I just don't see it in the same league as those
> other additions. Of course, you can work on whatever you want, but I
> was hoping to see another major feature addition for 7.2. We know we
> badly need auto-vacuum, improved replication, and point-in-time recover.
I don't like auto-vacuum approach in long term, WAL-based BAR is too easy
to do -:) (and you know that there is man who will do it, probably),
bidirectional sync replication is good to work on, but I'm more
interested in storage/transaction management now. And I'm not sure
if I'll have enough time for "another major feature in 7.2" anyway.
> It would be better to put work into one mechanism that would
> reuse all tuples.
This is what we're discussing now -:)
If community will not like UNDO then I'll probably try to implement
dead space collector which will read log files and so on. Easy to
#ifdef it in 7.2 to use in 7.3 (or so) with on-disk FSM. Also, I have
to implement logging for non-btree indices (anyway required for UNDO,
WAL-based BAR, WAL-based space reusing).
Vadim
From Inoue@tpf.co.jp Tue May 22 20:49:08 2001
Return-path: <Inoue@tpf.co.jp>
Received: from sd.tpf.co.jp (IDENT:qmailr@sd.tpf.co.jp [210.161.239.34])
by candle.pha.pa.us (8.10.1/8.10.1) with SMTP id f4N0n6Q16869
for <pgman@candle.pha.pa.us>; Tue, 22 May 2001 20:49:06 -0400 (EDT)
Received: (qmail 1210 invoked from network); 23 May 2001 00:49:05 -0000
Received: from unknown (HELO viscomail.tpf.co.jp) (100.0.0.108)
by sd2.10.0.100.in-addr.arpa with SMTP; 23 May 2001 00:49:05 -0000
Received: from tpf.co.jp (3d_note1 [126.0.1.61])
by viscomail.tpf.co.jp (8.8.8+Sun/8.8.8) with ESMTP id JAA10910;
Wed, 23 May 2001 09:48:57 +0900 (JST)
Message-ID: <3B0B091D.A5AF412E@tpf.co.jp>
Date: Wed, 23 May 2001 09:49:33 +0900
From: Hiroshi Inoue <Inoue@tpf.co.jp>
X-Mailer: Mozilla 4.73 [ja] (Windows NT 5.0; U)
X-Accept-Language: ja
MIME-Version: 1.0
To: Bruce Momjian <pgman@candle.pha.pa.us>
cc: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>,
"'Zeugswetter Andreas SB'" <ZeugswetterA@wien.spardat.at>,
The Hermit Hacker <scrappy@hub.org>, Tom Lane <tgl@sss.pgh.pa.us>,
pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
References: <200105221747.f4MHlF409586@candle.pha.pa.us>
Content-Type: text/plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit
Status: ORr
Bruce Momjian wrote:
>
> > > The ratio in a well tuned system should well favor outdated tuples.
> > > If someone ever adds "dirty read" it is also not the case that it
> > > is guaranteed, that nobody accesses the tuple you currently want
> > > to undo. So I really miss to see the big difference.
> >
> > It will not be guaranteed anyway as soon as we start removing
> > tuples without exclusive access to relation.
> >
> > And, I cannot say that I would implement UNDO because of
> > 1. (cleanup) OR 2. (savepoints) OR 4. (pg_log management)
> > but because of ALL of 1., 2., 4.
>
> OK, I understand your reasoning here, but I want to make a comment.
>
> Looking at the previous features you added, like subqueries, MVCC, or
> WAL, these were major features that greatly enhanced the system's
> capabilities.
>
> Now, looking at UNDO, I just don't see it in the same league as those
> other additions.
Hmm hasn't it been an agreement ? I know UNDO was planned
for 7.0 and I've never heard objections about it until
recently. People also have referred to an overwriting smgr
easily. Please tell me how to introduce an overwriting smgr
without UNDO.
regards,
Hiroshi Inoue
From pgsql-hackers-owner+M9233@postgresql.org Tue May 22 21:11:29 2001
Return-path: <pgsql-hackers-owner+M9233@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4N1BSQ24335
for <pgman@candle.pha.pa.us>; Tue, 22 May 2001 21:11:28 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4N1AsA58638;
Tue, 22 May 2001 21:10:54 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9233@postgresql.org)
Received: from candle.pha.pa.us (candle.navpoint.com [162.33.245.46])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4N0rlA52759
for <pgsql-hackers@postgresql.org>; Tue, 22 May 2001 20:53:47 -0400 (EDT)
(envelope-from pgman@candle.pha.pa.us)
Received: (from pgman@localhost)
by candle.pha.pa.us (8.10.1/8.10.1) id f4N0rNY17041;
Tue, 22 May 2001 20:53:23 -0400 (EDT)
From: Bruce Momjian <pgman@candle.pha.pa.us>
Message-ID: <200105230053.f4N0rNY17041@candle.pha.pa.us>
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
In-Reply-To: <3B0B091D.A5AF412E@tpf.co.jp> "from Hiroshi Inoue at May 23, 2001
09:49:33 am"
To: Hiroshi Inoue <Inoue@tpf.co.jp>
Date: Tue, 22 May 2001 20:53:23 -0400 (EDT)
cc: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>,
"'Zeugswetter Andreas SB'" <ZeugswetterA@wien.spardat.at>,
The Hermit Hacker <scrappy@hub.org>, Tom Lane <tgl@sss.pgh.pa.us>,
pgsql-hackers@postgresql.org
X-Mailer: ELM [version 2.4ME+ PL90 (25)]
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
> > Looking at the previous features you added, like subqueries, MVCC, or
> > WAL, these were major features that greatly enhanced the system's
> > capabilities.
> >
> > Now, looking at UNDO, I just don't see it in the same league as those
> > other additions.
>
> Hmm hasn't it been an agreement ? I know UNDO was planned
> for 7.0 and I've never heard objections about it until
> recently. People also have referred to an overwriting smgr
> easily. Please tell me how to introduce an overwriting smgr
> without UNDO.
I guess that is the question. Are we heading for an overwriting storage
manager? I didn't see that in Vadim's list of UNDO advantages, but
maybe that is his final goal. If so UNDO may make sense, but then the
question is how do we keep MVCC with an overwriting storage manager?
The only way I can see doing it is to throw the old tuples into the WAL
and have backends read through that for MVCC info.
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
From Inoue@tpf.co.jp Tue May 22 23:04:52 2001
Return-path: <Inoue@tpf.co.jp>
Received: from sd.tpf.co.jp (IDENT:qmailr@sd.tpf.co.jp [210.161.239.34])
by candle.pha.pa.us (8.10.1/8.10.1) with SMTP id f4N34nQ29601
for <pgman@candle.pha.pa.us>; Tue, 22 May 2001 23:04:50 -0400 (EDT)
Received: (qmail 11698 invoked from network); 23 May 2001 03:04:48 -0000
Received: from unknown (HELO viscomail.tpf.co.jp) (100.0.0.108)
by sd2.10.0.100.in-addr.arpa with SMTP; 23 May 2001 03:04:48 -0000
Received: from tpf.co.jp (3d_note1 [126.0.1.61])
by viscomail.tpf.co.jp (8.8.8+Sun/8.8.8) with ESMTP id MAA10968;
Wed, 23 May 2001 12:04:47 +0900 (JST)
Message-ID: <3B0B28F3.47F70E0F@tpf.co.jp>
Date: Wed, 23 May 2001 12:05:23 +0900
From: Hiroshi Inoue <Inoue@tpf.co.jp>
X-Mailer: Mozilla 4.73 [ja] (Windows NT 5.0; U)
X-Accept-Language: ja
MIME-Version: 1.0
To: Bruce Momjian <pgman@candle.pha.pa.us>
cc: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>,
"'Zeugswetter Andreas SB'" <ZeugswetterA@wien.spardat.at>,
The Hermit Hacker <scrappy@hub.org>, Tom Lane <tgl@sss.pgh.pa.us>,
pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
References: <200105230053.f4N0rNY17041@candle.pha.pa.us>
Content-Type: text/plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit
Status: OR
Bruce Momjian wrote:
>
> > > Looking at the previous features you added, like subqueries, MVCC, or
> > > WAL, these were major features that greatly enhanced the system's
> > > capabilities.
> > >
> > > Now, looking at UNDO, I just don't see it in the same league as those
> > > other additions.
> >
> > Hmm hasn't it been an agreement ? I know UNDO was planned
> > for 7.0 and I've never heard objections about it until
> > recently. People also have referred to an overwriting smgr
> > easily. Please tell me how to introduce an overwriting smgr
> > without UNDO.
>
> I guess that is the question. Are we heading for an overwriting storage
> manager?
I've never heard that it was given up. So there seems to be
at least a possibility to introduce it in the future.
PostgreSQL could have lived without UNDO due to its no
overwrite smgr. I don't know if avoiding UNDO is possible
to implement partial rollback(I don't think it's easy
anyway). However it seems harmful for the future
implementation of an overwriting smgr if we would
introduce it.
> I didn't see that in Vadim's list of UNDO advantages, but
> maybe that is his final goal.
> If so UNDO may make sense, but then the
> question is how do we keep MVCC with an overwriting storage manager?
>
It doesn't seem easy. ISTM it's one of the main reason we
couldn't introduce an overwriting smgr in 7.2.
regards,
Hiroshi Inoue
From pgsql-hackers-owner+M9241@postgresql.org Tue May 22 23:20:08 2001
Return-path: <pgsql-hackers-owner+M9241@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4N3K7Q00337
for <pgman@candle.pha.pa.us>; Tue, 22 May 2001 23:20:07 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4N3JgA97799;
Tue, 22 May 2001 23:19:42 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9241@postgresql.org)
Received: from sd.tpf.co.jp (sd.tpf.co.jp [210.161.239.34])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4N34tA93250
for <pgsql-hackers@postgresql.org>; Tue, 22 May 2001 23:04:56 -0400 (EDT)
(envelope-from Inoue@tpf.co.jp)
Received: (qmail 11698 invoked from network); 23 May 2001 03:04:48 -0000
Received: from unknown (HELO viscomail.tpf.co.jp) (100.0.0.108)
by sd2.10.0.100.in-addr.arpa with SMTP; 23 May 2001 03:04:48 -0000
Received: from tpf.co.jp (3d_note1 [126.0.1.61])
by viscomail.tpf.co.jp (8.8.8+Sun/8.8.8) with ESMTP id MAA10968;
Wed, 23 May 2001 12:04:47 +0900 (JST)
Message-ID: <3B0B28F3.47F70E0F@tpf.co.jp>
Date: Wed, 23 May 2001 12:05:23 +0900
From: Hiroshi Inoue <Inoue@tpf.co.jp>
X-Mailer: Mozilla 4.73 [ja] (Windows NT 5.0; U)
X-Accept-Language: ja
MIME-Version: 1.0
To: Bruce Momjian <pgman@candle.pha.pa.us>
cc: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>,
"'Zeugswetter Andreas SB'" <ZeugswetterA@wien.spardat.at>,
The Hermit Hacker <scrappy@hub.org>, Tom Lane <tgl@sss.pgh.pa.us>,
pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
References: <200105230053.f4N0rNY17041@candle.pha.pa.us>
Content-Type: text/plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
Bruce Momjian wrote:
>
> > > Looking at the previous features you added, like subqueries, MVCC, or
> > > WAL, these were major features that greatly enhanced the system's
> > > capabilities.
> > >
> > > Now, looking at UNDO, I just don't see it in the same league as those
> > > other additions.
> >
> > Hmm hasn't it been an agreement ? I know UNDO was planned
> > for 7.0 and I've never heard objections about it until
> > recently. People also have referred to an overwriting smgr
> > easily. Please tell me how to introduce an overwriting smgr
> > without UNDO.
>
> I guess that is the question. Are we heading for an overwriting storage
> manager?
I've never heard that it was given up. So there seems to be
at least a possibility to introduce it in the future.
PostgreSQL could have lived without UNDO due to its no
overwrite smgr. I don't know if avoiding UNDO is possible
to implement partial rollback(I don't think it's easy
anyway). However it seems harmful for the future
implementation of an overwriting smgr if we would
introduce it.
> I didn't see that in Vadim's list of UNDO advantages, but
> maybe that is his final goal.
> If so UNDO may make sense, but then the
> question is how do we keep MVCC with an overwriting storage manager?
>
It doesn't seem easy. ISTM it's one of the main reason we
couldn't introduce an overwriting smgr in 7.2.
regards,
Hiroshi Inoue
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly
From pjw@rhyme.com.au Wed May 23 05:01:44 2001
Return-path: <pjw@rhyme.com.au>
Received: from acheron.rime.com.au (albatr.lnk.telstra.net [139.130.54.222])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4N91YQ10467
for <pgman@candle.pha.pa.us>; Wed, 23 May 2001 05:01:42 -0400 (EDT)
Received: from oberon ([203.8.195.100])
by acheron.rime.com.au (8.11.2/8.11.2/SuSE Linux 8.11.1-0.5) with SMTP id f4N8x1K02874;
Wed, 23 May 2001 18:59:17 +1000
Message-ID: <3.0.5.32.20010523185858.00c24290@mail.rhyme.com.au>
X-Sender: pjw@mail.rhyme.com.au
X-Mailer: QUALCOMM Windows Eudora Pro Version 3.0.5 (32)
Date: Wed, 23 May 2001 18:58:58 +1000
To: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>,
"'Bruce Momjian'" <pgman@candle.pha.pa.us>
From: Philip Warner <pjw@rhyme.com.au>
Subject: RE: [HACKERS] Plans for solving the VACUUM problem
cc: "'Zeugswetter Andreas SB'" <ZeugswetterA@wien.spardat.at>,
The Hermit Hacker <scrappy@hub.org>, Tom Lane <tgl@sss.pgh.pa.us>,
pgsql-hackers@postgresql.org
In-Reply-To: <3705826352029646A3E91C53F7189E32016648@sectorbase2.sectorb
ase.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Status: OR
At 14:33 22/05/01 -0700, Mikheev, Vadim wrote:
>
>If community will not like UNDO then I'll probably try to implement
>dead space collector which will read log files and so on.
I'd vote for UNDO; in terms of usability & friendliness it's a big win.
Tom's plans for FSM etc are, at least, going to get us some useful data,
and at best will mean we can hang of WAL based FSM for a few versions.
----------------------------------------------------------------
Philip Warner | __---_____
Albatross Consulting Pty. Ltd. |----/ - \
(A.B.N. 75 008 659 498) | /(@) ______---_
Tel: (+61) 0500 83 82 81 | _________ \
Fax: (+61) 0500 83 82 82 | ___________ |
Http://www.rhyme.com.au | / \|
| --________--
PGP key available upon request, | /
and from pgp5.ai.mit.edu:11371 |/
From pgsql-hackers-owner+M9249@postgresql.org Wed May 23 06:18:40 2001
Return-path: <pgsql-hackers-owner+M9249@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4NAIeQ14309
for <pgman@candle.pha.pa.us>; Wed, 23 May 2001 06:18:40 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4NAHnA87259;
Wed, 23 May 2001 06:17:49 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9249@postgresql.org)
Received: from taru.tm.ee (taru.tm.ee [194.204.62.23])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4NA95A83396
for <pgsql-hackers@postgresql.org>; Wed, 23 May 2001 06:09:07 -0400 (EDT)
(envelope-from hannu@tm.ee)
Received: from tm.ee (localhost.localdomain [127.0.0.1])
by taru.tm.ee (8.11.2/8.11.2) with ESMTP id f4NABnI19798;
Wed, 23 May 2001 12:11:49 +0200
Message-ID: <3B0B8CE5.1D85B52D@tm.ee>
Date: Wed, 23 May 2001 12:11:49 +0200
From: Hannu Krosing <hannu@tm.ee>
X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.4.2-2 i686)
X-Accept-Language: et, en, ru
MIME-Version: 1.0
To: Hiroshi Inoue <Inoue@tpf.co.jp>
cc: Bruce Momjian <pgman@candle.pha.pa.us>,
"Mikheev, Vadim" <vmikheev@SECTORBASE.COM>,
"'Zeugswetter Andreas SB'" <ZeugswetterA@wien.spardat.at>,
The Hermit Hacker <scrappy@hub.org>, Tom Lane <tgl@sss.pgh.pa.us>,
pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
References: <200105221747.f4MHlF409586@candle.pha.pa.us> <3B0B091D.A5AF412E@tpf.co.jp>
Content-Type: text/plain; charset=iso-8859-15
Content-Transfer-Encoding: 7bit
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
Hiroshi Inoue wrote:
>
> People also have referred to an overwriting smgr easily.
I am all for an overwriting smgr, but as a feature that can be selected
on a table-by table basis (or at least in compile time), not as an
overall change
> Please tell me how to introduce an overwriting smgr
> without UNDO.
I would much more like a dead-space-reusing smgr on top of MVCC which
does
not touch live transactions.
------------------
Hannu
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
From tgl@sss.pgh.pa.us Wed May 23 15:31:29 2001
Return-path: <tgl@sss.pgh.pa.us>
Received: from sss.pgh.pa.us (tgl@sss.pgh.pa.us [216.151.103.158])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4NJVSQ00678
for <pgman@candle.pha.pa.us>; Wed, 23 May 2001 15:31:28 -0400 (EDT)
Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1])
by sss.pgh.pa.us (8.11.3/8.11.3) with ESMTP id f4NJVAR16596;
Wed, 23 May 2001 15:31:12 -0400 (EDT)
To: Hiroshi Inoue <Inoue@tpf.co.jp>
cc: Bruce Momjian <pgman@candle.pha.pa.us>,
"Mikheev,
Vadim" <vmikheev@SECTORBASE.COM>,
"'Zeugswetter Andreas SB'" <ZeugswetterA@wien.spardat.at>,
The Hermit Hacker <scrappy@hub.org>, pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
In-Reply-To: <3B0B28F3.47F70E0F@tpf.co.jp>
References: <200105230053.f4N0rNY17041@candle.pha.pa.us> <3B0B28F3.47F70E0F@tpf.co.jp>
Comments: In-reply-to Hiroshi Inoue <Inoue@tpf.co.jp>
message dated "Wed, 23 May 2001 12:05:23 +0900"
Date: Wed, 23 May 2001 15:31:10 -0400
Message-ID: <16593.990646270@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
Status: OR
Hiroshi Inoue <Inoue@tpf.co.jp> writes:
>> I guess that is the question. Are we heading for an overwriting storage
>> manager?
> I've never heard that it was given up. So there seems to be
> at least a possibility to introduce it in the future.
Unless we want to abandon MVCC (which I don't), I think an overwriting
smgr is impractical. We need a more complex space-reuse scheme than
that.
regards, tom lane
From Inoue@tpf.co.jp Wed May 23 19:14:31 2001
Return-path: <Inoue@tpf.co.jp>
Received: from sd.tpf.co.jp (IDENT:qmailr@sd.tpf.co.jp [210.161.239.34])
by candle.pha.pa.us (8.10.1/8.10.1) with SMTP id f4NNETQ22521
for <pgman@candle.pha.pa.us>; Wed, 23 May 2001 19:14:30 -0400 (EDT)
Received: (qmail 15859 invoked from network); 23 May 2001 23:14:29 -0000
Received: from unknown (HELO viscomail.tpf.co.jp) (100.0.0.108)
by sd2.10.0.100.in-addr.arpa with SMTP; 23 May 2001 23:14:29 -0000
Received: from tpf.co.jp (3d_note1 [126.0.1.61])
by viscomail.tpf.co.jp (8.8.8+Sun/8.8.8) with ESMTP id IAA11547;
Thu, 24 May 2001 08:14:28 +0900 (JST)
Message-ID: <3B0C447A.E6EF4AF3@tpf.co.jp>
Date: Thu, 24 May 2001 08:15:06 +0900
From: Hiroshi Inoue <Inoue@tpf.co.jp>
X-Mailer: Mozilla 4.73 [ja] (Windows NT 5.0; U)
X-Accept-Language: ja
MIME-Version: 1.0
To: Tom Lane <tgl@sss.pgh.pa.us>
cc: Bruce Momjian <pgman@candle.pha.pa.us>,
"Mikheev, Vadim" <vmikheev@SECTORBASE.COM>,
"'Zeugswetter Andreas SB'" <ZeugswetterA@wien.spardat.at>,
The Hermit Hacker <scrappy@hub.org>, pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
References: <200105230053.f4N0rNY17041@candle.pha.pa.us> <3B0B28F3.47F70E0F@tpf.co.jp> <16593.990646270@sss.pgh.pa.us>
Content-Type: text/plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit
Status: OR
Tom Lane wrote:
>
> Hiroshi Inoue <Inoue@tpf.co.jp> writes:
> >> I guess that is the question. Are we heading for an overwriting storage
> >> manager?
>
> > I've never heard that it was given up. So there seems to be
> > at least a possibility to introduce it in the future.
>
> Unless we want to abandon MVCC (which I don't), I think an overwriting
> smgr is impractical.
Impractical ? Oracle does it.
> We need a more complex space-reuse scheme than
> that.
>
IMHO we have to decide which to go now.
As I already mentioned, changing current handling
of transactionId/CommandId to avoid UNDO is not
only useless but also harmful for an overwriting
smgr.
regards,
Hiroshi Inoue
From dhogaza@pacifier.com Wed May 23 19:25:51 2001
Return-path: <dhogaza@pacifier.com>
Received: from asteroid.pacifier.com (asteroid.pacifier.com [199.2.117.154])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4NNPoQ22976
for <pgman@candle.pha.pa.us>; Wed, 23 May 2001 19:25:50 -0400 (EDT)
Received: from desktop (dsl-dhogaza.pacifier.net [207.202.226.68])
by asteroid.pacifier.com (8.11.2/8.11.1) with SMTP id f4NNOuM04072;
Wed, 23 May 2001 16:24:57 -0700 (PDT)
Message-ID: <3.0.1.32.20010523162448.01797330@mail.pacifier.com>
X-Sender: dhogaza@mail.pacifier.com
X-Mailer: Windows Eudora Pro Version 3.0.1 (32)
Date: Wed, 23 May 2001 16:24:48 -0700
To: Hiroshi Inoue <Inoue@tpf.co.jp>, Tom Lane <tgl@sss.pgh.pa.us>
From: Don Baccus <dhogaza@pacifier.com>
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
cc: Bruce Momjian <pgman@candle.pha.pa.us>,
"Mikheev, Vadim" <vmikheev@SECTORBASE.COM>,
"'Zeugswetter Andreas SB'" <ZeugswetterA@wien.spardat.at>,
The Hermit Hacker <scrappy@hub.org>, pgsql-hackers@postgresql.org
In-Reply-To: <3B0C447A.E6EF4AF3@tpf.co.jp>
References: <200105230053.f4N0rNY17041@candle.pha.pa.us>
<3B0B28F3.47F70E0F@tpf.co.jp>
<16593.990646270@sss.pgh.pa.us>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Status: OR
At 08:15 AM 5/24/01 +0900, Hiroshi Inoue wrote:
>> Unless we want to abandon MVCC (which I don't), I think an overwriting
>> smgr is impractical.
>
>Impractical ? Oracle does it.
It's not easy, though ... the current PG scheme has the advantage of being
relatively simple and probably more efficient than scanning logs like
Oracle has to do (assuming your datafiles aren't thoroughly clogged with
old dead tuples).
Has anyone looked at InterBase for hints for space-reusing strategies?
As I understand it, they have a tuple-versioning scheme similar to PG's.
If nothing else, something might be learned as to the efficiency and
effectiveness of one particular approach to solving the problem.
- Don Baccus, Portland OR <dhogaza@pacifier.com>
Nature photos, on-line guides, Pacific Northwest
Rare Bird Alert Service and other goodies at
http://donb.photo.net.
From pgsql-hackers-owner+M9291@postgresql.org Wed May 23 22:29:59 2001
Return-path: <pgsql-hackers-owner+M9291@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4O2TxQ08894
for <pgman@candle.pha.pa.us>; Wed, 23 May 2001 22:29:59 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4O2TWA68746;
Wed, 23 May 2001 22:29:32 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9291@postgresql.org)
Received: from sd.tpf.co.jp (sd.tpf.co.jp [210.161.239.34])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4O2LVA66613
for <pgsql-hackers@postgresql.org>; Wed, 23 May 2001 22:21:31 -0400 (EDT)
(envelope-from Inoue@tpf.co.jp)
Received: (qmail 29618 invoked from network); 24 May 2001 02:21:25 -0000
Received: from unknown (HELO viscomail.tpf.co.jp) (100.0.0.108)
by sd2.10.0.100.in-addr.arpa with SMTP; 24 May 2001 02:21:25 -0000
Received: from tpf.co.jp (3d_note1 [126.0.1.61])
by viscomail.tpf.co.jp (8.8.8+Sun/8.8.8) with ESMTP id LAA11655;
Thu, 24 May 2001 11:21:23 +0900 (JST)
Message-ID: <3B0C7048.902DD407@tpf.co.jp>
Date: Thu, 24 May 2001 11:22:00 +0900
From: Hiroshi Inoue <Inoue@tpf.co.jp>
X-Mailer: Mozilla 4.73 [ja] (Windows NT 5.0; U)
X-Accept-Language: ja
MIME-Version: 1.0
To: Don Baccus <dhogaza@pacifier.com>
cc: Tom Lane <tgl@sss.pgh.pa.us>, Bruce Momjian <pgman@candle.pha.pa.us>,
"Mikheev, Vadim" <vmikheev@SECTORBASE.COM>,
"'Zeugswetter Andreas SB'" <ZeugswetterA@wien.spardat.at>,
The Hermit Hacker <scrappy@hub.org>, pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
References: <200105230053.f4N0rNY17041@candle.pha.pa.us>
<3B0B28F3.47F70E0F@tpf.co.jp>
<16593.990646270@sss.pgh.pa.us> <3.0.1.32.20010523162448.01797330@mail.pacifier.com>
Content-Type: text/plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
Don Baccus wrote:
>
> At 08:15 AM 5/24/01 +0900, Hiroshi Inoue wrote:
>
> >> Unless we want to abandon MVCC (which I don't), I think an overwriting
> >> smgr is impractical.
> >
> >Impractical ? Oracle does it.
>
> It's not easy, though ... the current PG scheme has the advantage of being
> relatively simple and probably more efficient than scanning logs like
> Oracle has to do (assuming your datafiles aren't thoroughly clogged with
> old dead tuples).
>
I think so too. I've never said that an overwriting smgr
is easy and I don't love it particularily.
What I'm objecting is to avoid UNDO without giving up
an overwriting smgr. We shouldn't be noncommittal now.
regards,
Hiroshi Inoue
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly
From Inoue@tpf.co.jp Wed May 23 22:21:26 2001
Return-path: <Inoue@tpf.co.jp>
Received: from sd.tpf.co.jp (IDENT:qmailr@sd.tpf.co.jp [210.161.239.34])
by candle.pha.pa.us (8.10.1/8.10.1) with SMTP id f4O2LPQ08631
for <pgman@candle.pha.pa.us>; Wed, 23 May 2001 22:21:25 -0400 (EDT)
Received: (qmail 29618 invoked from network); 24 May 2001 02:21:25 -0000
Received: from unknown (HELO viscomail.tpf.co.jp) (100.0.0.108)
by sd2.10.0.100.in-addr.arpa with SMTP; 24 May 2001 02:21:25 -0000
Received: from tpf.co.jp (3d_note1 [126.0.1.61])
by viscomail.tpf.co.jp (8.8.8+Sun/8.8.8) with ESMTP id LAA11655;
Thu, 24 May 2001 11:21:23 +0900 (JST)
Message-ID: <3B0C7048.902DD407@tpf.co.jp>
Date: Thu, 24 May 2001 11:22:00 +0900
From: Hiroshi Inoue <Inoue@tpf.co.jp>
X-Mailer: Mozilla 4.73 [ja] (Windows NT 5.0; U)
X-Accept-Language: ja
MIME-Version: 1.0
To: Don Baccus <dhogaza@pacifier.com>
cc: Tom Lane <tgl@sss.pgh.pa.us>, Bruce Momjian <pgman@candle.pha.pa.us>,
"Mikheev, Vadim" <vmikheev@SECTORBASE.COM>,
"'Zeugswetter Andreas SB'" <ZeugswetterA@wien.spardat.at>,
The Hermit Hacker <scrappy@hub.org>, pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
References: <200105230053.f4N0rNY17041@candle.pha.pa.us>
<3B0B28F3.47F70E0F@tpf.co.jp>
<16593.990646270@sss.pgh.pa.us> <3.0.1.32.20010523162448.01797330@mail.pacifier.com>
Content-Type: text/plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit
Status: OR
Don Baccus wrote:
>
> At 08:15 AM 5/24/01 +0900, Hiroshi Inoue wrote:
>
> >> Unless we want to abandon MVCC (which I don't), I think an overwriting
> >> smgr is impractical.
> >
> >Impractical ? Oracle does it.
>
> It's not easy, though ... the current PG scheme has the advantage of being
> relatively simple and probably more efficient than scanning logs like
> Oracle has to do (assuming your datafiles aren't thoroughly clogged with
> old dead tuples).
>
I think so too. I've never said that an overwriting smgr
is easy and I don't love it particularily.
What I'm objecting is to avoid UNDO without giving up
an overwriting smgr. We shouldn't be noncommittal now.
regards,
Hiroshi Inoue
From dhogaza@pacifier.com Thu May 24 08:55:51 2001
Return-path: <dhogaza@pacifier.com>
Received: from asteroid.pacifier.com (asteroid.pacifier.com [199.2.117.154])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4OCtoQ02711
for <pgman@candle.pha.pa.us>; Thu, 24 May 2001 08:55:51 -0400 (EDT)
Received: from desktop (dsl-dhogaza.pacifier.net [207.202.226.68])
by asteroid.pacifier.com (8.11.2/8.11.1) with SMTP id f4OCt2M03955;
Thu, 24 May 2001 05:55:02 -0700 (PDT)
Message-ID: <3.0.1.32.20010523214243.017aab70@mail.pacifier.com>
X-Sender: dhogaza@mail.pacifier.com
X-Mailer: Windows Eudora Pro Version 3.0.1 (32)
Date: Wed, 23 May 2001 21:42:43 -0700
To: Tom Lane <tgl@sss.pgh.pa.us>, Hiroshi Inoue <Inoue@tpf.co.jp>
From: Don Baccus <dhogaza@pacifier.com>
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
cc: Bruce Momjian <pgman@candle.pha.pa.us>,
"Mikheev, Vadim" <vmikheev@SECTORBASE.COM>,
"'Zeugswetter Andreas SB'" <ZeugswetterA@wien.spardat.at>,
The Hermit Hacker <scrappy@hub.org>, pgsql-hackers@postgresql.org
In-Reply-To: <26782.990673338@sss.pgh.pa.us>
References: <3B0C447A.E6EF4AF3@tpf.co.jp>
<200105230053.f4N0rNY17041@candle.pha.pa.us>
<3B0B28F3.47F70E0F@tpf.co.jp>
<16593.990646270@sss.pgh.pa.us>
<3B0C447A.E6EF4AF3@tpf.co.jp>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Status: OR
At 11:02 PM 5/23/01 -0400, Tom Lane wrote:
>Hiroshi Inoue <Inoue@tpf.co.jp> writes:
>> Tom Lane wrote:
>>> Unless we want to abandon MVCC (which I don't), I think an overwriting
>>> smgr is impractical.
>
>> Impractical ? Oracle does it.
>
>Oracle has MVCC?
With restrictions, yes. You didn't know that? Vadim did ...
- Don Baccus, Portland OR <dhogaza@pacifier.com>
Nature photos, on-line guides, Pacific Northwest
Rare Bird Alert Service and other goodies at
http://donb.photo.net.
From pgsql-hackers-owner+M9319@postgresql.org Thu May 24 13:21:55 2001
Return-path: <pgsql-hackers-owner+M9319@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4OHLtt18473
for <pgman@candle.pha.pa.us>; Thu, 24 May 2001 13:21:55 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4OHLMA41708;
Thu, 24 May 2001 13:21:22 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9319@postgresql.org)
Received: from mailer.sectorbase.com (mailer.sectorbase.com [63.88.121.2])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4OH1fA33215
for <pgsql-hackers@postgresql.org>; Thu, 24 May 2001 13:01:42 -0400 (EDT)
(envelope-from vmikheev@SECTORBASE.COM)
Received: (qmail 84033 invoked by uid 503); 24 May 2001 17:01:41 -0000
Received: from sectorbase2.sectorbase.com (192.168.254.2)
by gate1.sectorbase.com with SMTP; 24 May 2001 17:01:41 -0000
Received: by sectorbase2.sectorbase.com with Internet Mail Service (5.5.2653.19)
id <LG3CDGHJ>; Thu, 24 May 2001 10:00:31 -0700
Message-ID: <3705826352029646A3E91C53F7189E32016650@sectorbase2.sectorbase.com>
From: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>
To: "'Don Baccus'" <dhogaza@pacifier.com>, Tom Lane <tgl@sss.pgh.pa.us>,
Hiroshi Inoue <Inoue@tpf.co.jp>
cc: Bruce Momjian <pgman@candle.pha.pa.us>,
"'Zeugswetter Andreas SB'"
<ZeugswetterA@wien.spardat.at>,
The Hermit Hacker <scrappy@hub.org>, pgsql-hackers@postgresql.org
Subject: RE: [HACKERS] Plans for solving the VACUUM problem
Date: Thu, 24 May 2001 10:00:31 -0700
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
Content-Type: text/plain;
charset="iso-8859-1"
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
> >> Impractical ? Oracle does it.
> >
> >Oracle has MVCC?
>
> With restrictions, yes.
What restrictions? Rollback segments size?
Non-overwriting smgr can eat all disk space...
> You didn't know that? Vadim did ...
Didn't I mention a few times that I was
inspired by Oracle? -:)
Vadim
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
From pgsql-hackers-owner+M9322@postgresql.org Thu May 24 13:49:18 2001
Return-path: <pgsql-hackers-owner+M9322@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4OHnIt19501
for <pgman@candle.pha.pa.us>; Thu, 24 May 2001 13:49:18 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4OHmoA53643;
Thu, 24 May 2001 13:48:50 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9322@postgresql.org)
Received: from mailer.sectorbase.com (mailer.sectorbase.com [63.88.121.2])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4OHVoA46193
for <pgsql-hackers@postgresql.org>; Thu, 24 May 2001 13:31:51 -0400 (EDT)
(envelope-from vmikheev@SECTORBASE.COM)
Received: (qmail 90475 invoked by uid 503); 24 May 2001 17:31:50 -0000
Received: from sectorbase2.sectorbase.com (192.168.254.2)
by gate1.sectorbase.com with SMTP; 24 May 2001 17:31:50 -0000
Received: by sectorbase2.sectorbase.com with Internet Mail Service (5.5.2653.19)
id <LG3CDGKJ>; Thu, 24 May 2001 10:30:40 -0700
Message-ID: <3705826352029646A3E91C53F7189E32016651@sectorbase2.sectorbase.com>
From: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>
To: "'Zeugswetter Andreas SB'" <ZeugswetterA@wien.spardat.at>,
"'Bruce Momjian'" <pgman@candle.pha.pa.us>, Hiroshi Inoue <Inoue@tpf.co.jp>
cc: The Hermit Hacker <scrappy@hub.org>, Tom Lane <tgl@sss.pgh.pa.us>,
pgsql-hackers@postgresql.org
Subject: RE: [HACKERS] Plans for solving the VACUUM problem
Date: Thu, 24 May 2001 10:30:39 -0700
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
Content-Type: text/plain;
charset="iso-8859-1"
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
> If PostgreSQL wants to stay MVCC, then we should imho forget
> "overwriting smgr" very fast.
>
> Let me try to list the pros and cons that I can think of:
> Pro:
> no index modification if key stays same
> no search for free space for update (if tuple still
> fits into page)
> no pg_log
> Con:
> additional IO to write "before image" to rollback segment
> (every before image, not only first after checkpoint)
> (also before image of every index page that is updated !)
I don't think that Oracle writes entire page as before image - just
tuple data and some control info. As for additional IO - we'll do it
anyway to remove "before image" (deleted tuple data) from data files.
Vadim
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?
http://www.postgresql.org/search.mpl
From vmikheev@SECTORBASE.COM Thu May 24 13:31:55 2001
Return-path: <vmikheev@SECTORBASE.COM>
Received: from mailer.sectorbase.com (mailer.sectorbase.com [63.88.121.2])
by candle.pha.pa.us (8.10.1/8.10.1) with SMTP id f4OHVtt18902
for <pgman@candle.pha.pa.us>; Thu, 24 May 2001 13:31:55 -0400 (EDT)
Received: (qmail 90475 invoked by uid 503); 24 May 2001 17:31:50 -0000
Received: from sectorbase2.sectorbase.com (192.168.254.2)
by gate1.sectorbase.com with SMTP; 24 May 2001 17:31:50 -0000
Received: by sectorbase2.sectorbase.com with Internet Mail Service (5.5.2653.19)
id <LG3CDGKJ>; Thu, 24 May 2001 10:30:40 -0700
Message-ID: <3705826352029646A3E91C53F7189E32016651@sectorbase2.sectorbase.com>
From: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>
To: "'Zeugswetter Andreas SB'" <ZeugswetterA@wien.spardat.at>,
"'Bruce Momjian'" <pgman@candle.pha.pa.us>, Hiroshi Inoue <Inoue@tpf.co.jp>
cc: The Hermit Hacker <scrappy@hub.org>, Tom Lane <tgl@sss.pgh.pa.us>,
pgsql-hackers@postgresql.org
Subject: RE: [HACKERS] Plans for solving the VACUUM problem
Date: Thu, 24 May 2001 10:30:39 -0700
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
Content-Type: text/plain;
charset="iso-8859-1"
Status: OR
> If PostgreSQL wants to stay MVCC, then we should imho forget
> "overwriting smgr" very fast.
>
> Let me try to list the pros and cons that I can think of:
> Pro:
> no index modification if key stays same
> no search for free space for update (if tuple still
> fits into page)
> no pg_log
> Con:
> additional IO to write "before image" to rollback segment
> (every before image, not only first after checkpoint)
> (also before image of every index page that is updated !)
I don't think that Oracle writes entire page as before image - just
tuple data and some control info. As for additional IO - we'll do it
anyway to remove "before image" (deleted tuple data) from data files.
Vadim
From pgsql-hackers-owner+M9327@postgresql.org Thu May 24 14:23:44 2001
Return-path: <pgsql-hackers-owner+M9327@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4OINit21100
for <pgman@candle.pha.pa.us>; Thu, 24 May 2001 14:23:44 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4OINAA69817;
Thu, 24 May 2001 14:23:10 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9327@postgresql.org)
Received: from mailer.sectorbase.com (mailer.sectorbase.com [63.88.121.2])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4OHwVA57438
for <pgsql-hackers@postgresql.org>; Thu, 24 May 2001 13:58:31 -0400 (EDT)
(envelope-from vmikheev@SECTORBASE.COM)
Received: (qmail 96204 invoked by uid 503); 24 May 2001 17:58:30 -0000
Received: from sectorbase2.sectorbase.com (192.168.254.2)
by gate1.sectorbase.com with SMTP; 24 May 2001 17:58:30 -0000
Received: by sectorbase2.sectorbase.com with Internet Mail Service (5.5.2653.19)
id <LG3CDGMN>; Thu, 24 May 2001 10:57:20 -0700
Message-ID: <3705826352029646A3E91C53F7189E32016652@sectorbase2.sectorbase.com>
From: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>
To: "'Hiroshi Inoue'" <Inoue@tpf.co.jp>, Don Baccus <dhogaza@pacifier.com>
cc: Tom Lane <tgl@sss.pgh.pa.us>, Bruce Momjian <pgman@candle.pha.pa.us>,
"'Zeugswetter Andreas SB'" <ZeugswetterA@wien.spardat.at>,
The Hermit Hacker <scrappy@hub.org>, pgsql-hackers@postgresql.org
Subject: RE: [HACKERS] Plans for solving the VACUUM problem
Date: Thu, 24 May 2001 10:57:19 -0700
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
Content-Type: text/plain;
charset="iso-2022-jp"
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
> I think so too. I've never said that an overwriting smgr
> is easy and I don't love it particularily.
>
> What I'm objecting is to avoid UNDO without giving up
> an overwriting smgr. We shouldn't be noncommittal now.
Why not? We could decide to do overwriting smgr later
and implement UNDO then. For the moment we could just
change checkpointer to use checkpoint.redo instead of
checkpoint.undo when defining what log files should be
deleted - it's a few minutes deal, and so is changing it
back.
Vadim
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
From dhogaza@pacifier.com Mon May 28 10:42:51 2001
Return-path: <dhogaza@pacifier.com>
Received: from comet.pacifier.com (comet.pacifier.com [199.2.117.155])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4SEgog06154
for <pgman@candle.pha.pa.us>; Mon, 28 May 2001 10:42:50 -0400 (EDT)
Received: from desktop (dsl-dhogaza.pacifier.net [207.202.226.68])
by comet.pacifier.com (8.11.2/8.11.1) with SMTP id f4SEg2i04695;
Mon, 28 May 2001 07:42:03 -0700 (PDT)
Message-ID: <3.0.1.32.20010524111646.01776100@mail.pacifier.com>
X-Sender: dhogaza@mail.pacifier.com
X-Mailer: Windows Eudora Pro Version 3.0.1 (32)
Date: Thu, 24 May 2001 11:16:46 -0700
To: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>, Tom Lane <tgl@sss.pgh.pa.us>,
Hiroshi Inoue <Inoue@tpf.co.jp>
From: Don Baccus <dhogaza@pacifier.com>
Subject: RE: [HACKERS] Plans for solving the VACUUM problem
cc: Bruce Momjian <pgman@candle.pha.pa.us>,
"'Zeugswetter Andreas SB'" <ZeugswetterA@wien.spardat.at>,
The Hermit Hacker <scrappy@hub.org>, pgsql-hackers@postgresql.org
In-Reply-To: <3705826352029646A3E91C53F7189E32016650@sectorbase2.sectorb
ase.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Status: OR
At 10:00 AM 5/24/01 -0700, Mikheev, Vadim wrote:
>> >> Impractical ? Oracle does it.
>> >
>> >Oracle has MVCC?
>>
>> With restrictions, yes.
>
>What restrictions? Rollback segments size?
>Non-overwriting smgr can eat all disk space...
Actually, the restriction I'm thinking about isn't MVCC related, per
se, but a within-transaction restriction. The infamous "mutating table"
error.
>> You didn't know that? Vadim did ...
>
>Didn't I mention a few times that I was
>inspired by Oracle? -:)
Yes, you most certainly have!
- Don Baccus, Portland OR <dhogaza@pacifier.com>
Nature photos, on-line guides, Pacific Northwest
Rare Bird Alert Service and other goodies at
http://donb.photo.net.
From pgsql-hackers-owner+M9344@postgresql.org Thu May 24 20:00:27 2001
Return-path: <pgsql-hackers-owner+M9344@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4P00Qt19276
for <pgman@candle.pha.pa.us>; Thu, 24 May 2001 20:00:27 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4ONxtA85777;
Thu, 24 May 2001 19:59:55 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9344@postgresql.org)
Received: from rh72.home.ee (adsl895.estpak.ee [213.168.23.133])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4ONtVA84581
for <pgsql-hackers@postgresql.org>; Thu, 24 May 2001 19:55:31 -0400 (EDT)
(envelope-from hannu@tm.ee)
Received: from tm.ee (rh72.home.ee [127.0.0.1])
by rh72.home.ee (8.11.2/8.11.2) with ESMTP id f4OKp6T01940;
Fri, 25 May 2001 01:51:06 +0500
Message-ID: <3B0D743A.B57B76A0@tm.ee>
Date: Fri, 25 May 2001 01:51:06 +0500
From: Hannu Krosing <hannu@tm.ee>
X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.4.2-2 i686)
X-Accept-Language: en, ru, et
MIME-Version: 1.0
To: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>
cc: "'Don Baccus'" <dhogaza@pacifier.com>, Tom Lane <tgl@sss.pgh.pa.us>,
Hiroshi Inoue <Inoue@tpf.co.jp>, Bruce Momjian <pgman@candle.pha.pa.us>,
"'Zeugswetter Andreas SB'" <ZeugswetterA@wien.spardat.at>,
The Hermit Hacker <scrappy@hub.org>, pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
References: <3705826352029646A3E91C53F7189E32016650@sectorbase2.sectorbase.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
"Mikheev, Vadim" wrote:
>
> > >> Impractical ? Oracle does it.
> > >
> > >Oracle has MVCC?
> >
> > With restrictions, yes.
>
> What restrictions? Rollback segments size?
> Non-overwriting smgr can eat all disk space...
Is'nt the same true for an overwriting smgr ? ;)
> > You didn't know that? Vadim did ...
>
> Didn't I mention a few times that I was
> inspired by Oracle? -:)
How does it do MVCC with an overwriting storage manager ?
Could it possibly be a Postgres-inspired bolted-on hack
needed for better concurrency ?
BTW, are you aware how Interbase does its MVCC - is it more
like Oracle's way or like PostgreSQL's ?
----------------
Hannu
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly
From pgsql-hackers-owner+M9345@postgresql.org Thu May 24 20:14:28 2001
Return-path: <pgsql-hackers-owner+M9345@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4P0ERt20188
for <pgman@candle.pha.pa.us>; Thu, 24 May 2001 20:14:27 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4P0DBA89822;
Thu, 24 May 2001 20:13:12 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9345@postgresql.org)
Received: from rh72.home.ee (adsl895.estpak.ee [213.168.23.133])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4P08qA88602
for <pgsql-hackers@postgresql.org>; Thu, 24 May 2001 20:08:52 -0400 (EDT)
(envelope-from hannu@tm.ee)
Received: from tm.ee (rh72.home.ee [127.0.0.1])
by rh72.home.ee (8.11.2/8.11.2) with ESMTP id f4OL5JT01975;
Fri, 25 May 2001 02:05:19 +0500
Message-ID: <3B0D778F.8DF75D48@tm.ee>
Date: Fri, 25 May 2001 02:05:19 +0500
From: Hannu Krosing <hannu@tm.ee>
X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.4.2-2 i686)
X-Accept-Language: en, ru, et
MIME-Version: 1.0
To: Don Baccus <dhogaza@pacifier.com>
cc: Hiroshi Inoue <Inoue@tpf.co.jp>, Tom Lane <tgl@sss.pgh.pa.us>,
Bruce Momjian <pgman@candle.pha.pa.us>,
"Mikheev, Vadim" <vmikheev@SECTORBASE.COM>,
"'Zeugswetter Andreas SB'" <ZeugswetterA@wien.spardat.at>,
The Hermit Hacker <scrappy@hub.org>, pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
References: <200105230053.f4N0rNY17041@candle.pha.pa.us>
<3B0B28F3.47F70E0F@tpf.co.jp>
<16593.990646270@sss.pgh.pa.us> <3.0.1.32.20010523162448.01797330@mail.pacifier.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
Don Baccus wrote:
>
> At 08:15 AM 5/24/01 +0900, Hiroshi Inoue wrote:
>
> >> Unless we want to abandon MVCC (which I don't), I think an overwriting
> >> smgr is impractical.
> >
> >Impractical ? Oracle does it.
>
> It's not easy, though ... the current PG scheme has the advantage of being
> relatively simple and probably more efficient than scanning logs like
> Oracle has to do (assuming your datafiles aren't thoroughly clogged with
> old dead tuples).
>
> Has anyone looked at InterBase for hints for space-reusing strategies?
>
> As I understand it, they have a tuple-versioning scheme similar to PG's.
>
> If nothing else, something might be learned as to the efficiency and
> effectiveness of one particular approach to solving the problem.
It may also be beneficial to study SapDB (which is IIRC a branch-off of
Adabas) although they claim at http://www.sapdb.org/ in features
section:
NOT supported features:
Collations
Result sets that are created within a stored procedure and
fetched outside. This feature is planned to be
offered in one of the coming releases.
Meanwhile, use temporary tables.
see Reference Manual: SAP DB 7.2 and 7.3 -> Data
definition -> CREATE TABLE statement: Owner of a
table
Multi version concurrency for OLTP
It is available with the object extension of SAPDB only.
Hot stand by
This feature is planned to be offered in one of the coming
releases.
So MVCC seems to be a bolt-on feature there.
---------------------
Hannu
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
From pgsql-hackers-owner+M9343@postgresql.org Thu May 24 19:58:01 2001
Return-path: <pgsql-hackers-owner+M9343@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4ONw0t19025
for <pgman@candle.pha.pa.us>; Thu, 24 May 2001 19:58:01 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4ONvPA85057;
Thu, 24 May 2001 19:57:25 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9343@postgresql.org)
Received: from sd.tpf.co.jp (sd.tpf.co.jp [210.161.239.34])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4ONpSA83441
for <pgsql-hackers@postgresql.org>; Thu, 24 May 2001 19:51:30 -0400 (EDT)
(envelope-from Inoue@tpf.co.jp)
Received: (qmail 7484 invoked from network); 24 May 2001 23:51:13 -0000
Received: from unknown (HELO viscomail.tpf.co.jp) (100.0.0.108)
by sd2.10.0.100.in-addr.arpa with SMTP; 24 May 2001 23:51:13 -0000
Received: from tpf.co.jp (3d_note1 [126.0.1.61])
by viscomail.tpf.co.jp (8.8.8+Sun/8.8.8) with ESMTP id IAA12184;
Fri, 25 May 2001 08:51:06 +0900 (JST)
Message-ID: <3B0D9E90.8DB98EFC@tpf.co.jp>
Date: Fri, 25 May 2001 08:51:44 +0900
From: Hiroshi Inoue <Inoue@tpf.co.jp>
X-Mailer: Mozilla 4.73 [ja] (Windows NT 5.0; U)
X-Accept-Language: ja
MIME-Version: 1.0
To: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>
cc: Don Baccus <dhogaza@pacifier.com>, Tom Lane <tgl@sss.pgh.pa.us>,
Bruce Momjian <pgman@candle.pha.pa.us>,
"'Zeugswetter Andreas SB'" <ZeugswetterA@wien.spardat.at>,
The Hermit Hacker <scrappy@hub.org>, pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
References: <3705826352029646A3E91C53F7189E32016652@sectorbase2.sectorbase.com>
Content-Type: text/plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: ORr
"Mikheev, Vadim" wrote:
>
> > I think so too. I've never said that an overwriting smgr
> > is easy and I don't love it particularily.
> >
> > What I'm objecting is to avoid UNDO without giving up
> > an overwriting smgr. We shouldn't be noncommittal now.
>
> Why not? We could decide to do overwriting smgr later
> and implement UNDO then.
What I'm refering to is the discussion about the handling
of subtransactions in order to introduce the savepoints
functionality. Or do we postpone *savepoints* again ?
I realize now few people have had the idea how to switch
to an overwriting smgr. I don't think an overwriting smgr
could be achived at once and we have to prepare one by one
for it. AFAIK there's no idea how to introduce an overwriting
smgr without UNDO. If we avoid UNDO now when overwriting smgr
would appear ? I also think that the problems Andreas has
specified are pretty serious. I also have known the problems
and I've expected that people have the idea to solve it but
... I'm inclined to give up an overwriting smgr now.
regards,
Hiroshi Inoue
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly
From pgsql-hackers-owner+M9347@postgresql.org Thu May 24 20:31:27 2001
Return-path: <pgsql-hackers-owner+M9347@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4P0VQt21167
for <pgman@candle.pha.pa.us>; Thu, 24 May 2001 20:31:26 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4P0V1A94671;
Thu, 24 May 2001 20:31:01 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9347@postgresql.org)
Received: from acheron.rime.com.au (albatr.lnk.telstra.net [139.130.54.222])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4P0QkA93400
for <pgsql-hackers@postgresql.org>; Thu, 24 May 2001 20:26:46 -0400 (EDT)
(envelope-from pjw@rhyme.com.au)
Received: from oberon (Oberon.rime.com.au [203.8.195.100])
by acheron.rime.com.au (8.11.2/8.11.2/SuSE Linux 8.11.1-0.5) with SMTP id f4P0LbK15911;
Fri, 25 May 2001 10:21:37 +1000
Message-ID: <3.0.5.32.20010525102137.0395e100@mail.rhyme.com.au>
X-Sender: pjw@mail.rhyme.com.au
X-Mailer: QUALCOMM Windows Eudora Pro Version 3.0.5 (32)
Date: Fri, 25 May 2001 10:21:37 +1000
To: Hannu Krosing <hannu@tm.ee>, "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>
From: Philip Warner <pjw@rhyme.com.au>
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
cc: "'Don Baccus'" <dhogaza@pacifier.com>, Tom Lane <tgl@sss.pgh.pa.us>,
Hiroshi Inoue <Inoue@tpf.co.jp>, Bruce Momjian <pgman@candle.pha.pa.us>,
"'Zeugswetter Andreas SB'" <ZeugswetterA@wien.spardat.at>,
The Hermit Hacker <scrappy@hub.org>, pgsql-hackers@postgresql.org
In-Reply-To: <3B0D743A.B57B76A0@tm.ee>
References: <3705826352029646A3E91C53F7189E32016650@sectorbase2.sectorbase.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
At 01:51 25/05/01 +0500, Hannu Krosing wrote:
>
>How does it do MVCC with an overwriting storage manager ?
>
I don't know about Oracle, but Dec/RDB also does overwriting and MVCC. It
does this by taking a snapshot of pages that are participating in both RW
and RO transactions (De/RDB has the options on SET TRANSACTION that specify
if the TX will do updates or not). It has the disadvantage that the
snapshot will grow quite large for bulk loads. Typically they are about
10-20% of DB size. Pages are freed from the snapshot as active TXs finish.
Note that the snapshots are separate from the journalling (WAL) and
rollback files.
----------------------------------------------------------------
Philip Warner | __---_____
Albatross Consulting Pty. Ltd. |----/ - \
(A.B.N. 75 008 659 498) | /(@) ______---_
Tel: (+61) 0500 83 82 81 | _________ \
Fax: (+61) 0500 83 82 82 | ___________ |
Http://www.rhyme.com.au | / \|
| --________--
PGP key available upon request, | /
and from pgp5.ai.mit.edu:11371 |/
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
From pgsql-hackers-owner+M9346@postgresql.org Thu May 24 20:30:01 2001
Return-path: <pgsql-hackers-owner+M9346@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4P0U0t21115
for <pgman@candle.pha.pa.us>; Thu, 24 May 2001 20:30:00 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4P0TXA94058;
Thu, 24 May 2001 20:29:33 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9346@postgresql.org)
Received: from mailer.sectorbase.com (mailer.sectorbase.com [63.88.121.2])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4P0OdA92709
for <pgsql-hackers@postgresql.org>; Thu, 24 May 2001 20:24:39 -0400 (EDT)
(envelope-from vmikheev@SECTORBASE.COM)
Received: (qmail 31434 invoked by uid 503); 25 May 2001 00:24:31 -0000
Received: from sectorbase2.sectorbase.com (192.168.254.2)
by gate1.sectorbase.com with SMTP; 25 May 2001 00:24:31 -0000
Received: by sectorbase2.sectorbase.com with Internet Mail Service (5.5.2653.19)
id <LG3CDHJ0>; Thu, 24 May 2001 17:23:20 -0700
Message-ID: <3705826352029646A3E91C53F7189E32016655@sectorbase2.sectorbase.com>
From: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>
To: "'Hannu Krosing'" <hannu@tm.ee>
cc: "'Don Baccus'" <dhogaza@pacifier.com>, Tom Lane <tgl@sss.pgh.pa.us>,
Hiroshi Inoue <Inoue@tpf.co.jp>, Bruce Momjian <pgman@candle.pha.pa.us>,
"'Zeugswetter Andreas SB'" <ZeugswetterA@wien.spardat.at>,
The Hermit Hacker <scrappy@hub.org>, pgsql-hackers@postgresql.org
Subject: RE: [HACKERS] Plans for solving the VACUUM problem
Date: Thu, 24 May 2001 17:23:19 -0700
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
Content-Type: text/plain;
charset="iso-8859-1"
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
> > > >Oracle has MVCC?
> > >
> > > With restrictions, yes.
> >
> > What restrictions? Rollback segments size?
> > Non-overwriting smgr can eat all disk space...
>
> Is'nt the same true for an overwriting smgr ? ;)
Removing dead records from rollback segments should
be faster than from datafiles.
> > > You didn't know that? Vadim did ...
> >
> > Didn't I mention a few times that I was
> > inspired by Oracle? -:)
>
> How does it do MVCC with an overwriting storage manager ?
1. System Change Number (SCN) is used: system increments it
on each transaction commit.
2. When scan meets data block with SCN > SCN as it was when
query/transaction started, old block image is restored
using rollback segments.
> Could it possibly be a Postgres-inspired bolted-on hack
> needed for better concurrency ?
-:)) Oracle has MVCC for years, probably from the beginning
and for sure before Postgres.
> BTW, are you aware how Interbase does its MVCC - is it more
> like Oracle's way or like PostgreSQL's ?
Like ours.
Vadim
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?
http://www.postgresql.org/search.mpl
From pgsql-hackers-owner+M9348@postgresql.org Thu May 24 21:13:34 2001
Return-path: <pgsql-hackers-owner+M9348@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4P1DYt24746
for <pgman@candle.pha.pa.us>; Thu, 24 May 2001 21:13:34 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4P1D9A05820;
Thu, 24 May 2001 21:13:09 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9348@postgresql.org)
Received: from candle.pha.pa.us (candle.navpoint.com [162.33.245.46])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4P164A03993
for <pgsql-hackers@postgresql.org>; Thu, 24 May 2001 21:06:04 -0400 (EDT)
(envelope-from pgman@candle.pha.pa.us)
Received: (from pgman@localhost)
by candle.pha.pa.us (8.10.1/8.10.1) id f4P108j23173;
Thu, 24 May 2001 21:00:08 -0400 (EDT)
From: Bruce Momjian <pgman@candle.pha.pa.us>
Message-ID: <200105250100.f4P108j23173@candle.pha.pa.us>
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
In-Reply-To: <3B0D9E90.8DB98EFC@tpf.co.jp> "from Hiroshi Inoue at May 25, 2001
08:51:44 am"
To: Hiroshi Inoue <Inoue@tpf.co.jp>
Date: Thu, 24 May 2001 21:00:08 -0400 (EDT)
cc: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>,
Don Baccus <dhogaza@pacifier.com>, Tom Lane <tgl@sss.pgh.pa.us>,
"'Zeugswetter Andreas SB'" <ZeugswetterA@wien.spardat.at>,
The Hermit Hacker <scrappy@hub.org>, pgsql-hackers@postgresql.org
X-Mailer: ELM [version 2.4ME+ PL90 (25)]
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
> What I'm refering to is the discussion about the handling
> of subtransactions in order to introduce the savepoints
> functionality. Or do we postpone *savepoints* again ?
>
> I realize now few people have had the idea how to switch
> to an overwriting smgr. I don't think an overwriting smgr
> could be achived at once and we have to prepare one by one
> for it. AFAIK there's no idea how to introduce an overwriting
> smgr without UNDO. If we avoid UNDO now when overwriting smgr
> would appear ? I also think that the problems Andreas has
> specified are pretty serious. I also have known the problems
> and I've expected that people have the idea to solve it but
> ... I'm inclined to give up an overwriting smgr now.
Now that everyone has commented on the UNDO issue, I thought I would try
to summarize the comments so we can come to some kind of conclusion.
Here are the issues as I see them:
---------------------------------------------------------------------------
Do we want to keep MVCC?
Yes. No one has said otherwise.
---------------------------------------------------------------------------
Do we want to head for an overwriting storage manager?
Not sure.
Advantages: UPDATE has easy space reuse because usually done in-place,
no index change on UPDATE unless key is changed.
Disadvantages: Old records have to be stored somewhere for MVCC use.
Could limit transaction size.
---------------------------------------------------------------------------
Do we want UNDO _if_ we are heading for an overwriting storage manager?
Everyone seems to say yes.
---------------------------------------------------------------------------
Do we want UNDO if we are _not_ heading for an overwriting storage
manager?
This is the tough one. UNDO advantages are:
Make subtransactions easier by rolling back aborted subtransaction.
Workaround is using a new transactions id for each subtransaction.
Easy space reuse for aborted transactions.
Reduce size of pg_log.
UNDO disadvantages are:
Limit size of transactions to log storage size.
---------------------------------------------------------------------------
If we are heading for an overwriting storage manager, we may as well get
UNDO now. If we are not, then we have to decide if we can solve the
problems that UNDO would fix. Basically, can we solve those problems
easier without UNDO, or are the disadvanges of UNDO too great?
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
From pgsql-hackers-owner+M9356@postgresql.org Fri May 25 05:15:44 2001
Return-path: <pgsql-hackers-owner+M9356@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4P9Fht13195
for <pgman@candle.pha.pa.us>; Fri, 25 May 2001 05:15:43 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4P9EgA03190;
Fri, 25 May 2001 05:14:42 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9356@postgresql.org)
Received: from rh72.home.ee (adsl895.estpak.ee [213.168.23.133])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4P96nA00120
for <pgsql-hackers@postgresql.org>; Fri, 25 May 2001 05:06:50 -0400 (EDT)
(envelope-from hannu@tm.ee)
Received: from tm.ee (rh72.home.ee [127.0.0.1])
by rh72.home.ee (8.11.2/8.11.2) with ESMTP id f4P61rf01629;
Fri, 25 May 2001 11:01:54 +0500
Message-ID: <3B0DF551.275F382C@tm.ee>
Date: Fri, 25 May 2001 11:01:53 +0500
From: Hannu Krosing <hannu@tm.ee>
X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.4.2-2 i686)
X-Accept-Language: en, ru, et
MIME-Version: 1.0
To: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>
cc: "'Don Baccus'" <dhogaza@pacifier.com>, Tom Lane <tgl@sss.pgh.pa.us>,
Hiroshi Inoue <Inoue@tpf.co.jp>, Bruce Momjian <pgman@candle.pha.pa.us>,
"'Zeugswetter Andreas SB'" <ZeugswetterA@wien.spardat.at>,
The Hermit Hacker <scrappy@hub.org>, pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
References: <3705826352029646A3E91C53F7189E32016655@sectorbase2.sectorbase.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
"Mikheev, Vadim" wrote:
>
> > > > >Oracle has MVCC?
> > > >
> > > > With restrictions, yes.
> > >
> > > What restrictions? Rollback segments size?
> > > Non-overwriting smgr can eat all disk space...
> >
> > Is'nt the same true for an overwriting smgr ? ;)
>
> Removing dead records from rollback segments should
> be faster than from datafiles.
Is it for better locality or are they stored in a different way ?
Do you think that there is some fundamental performance advantage
in making a copy to rollback segment and then deleting it from
there vs. reusing space in datafiles ?
One thing (not having to updata non-changing index entries) can be
quite substantial under some scenarios, but there are probably ways
to at least speed up part of this by doing other compromizes, perhaps
by saving more info in index leaf (trading lookup speed for space
and insert speed) or chaining data pages (trading insert speed for
(some) space and lookup speed)
> > > > You didn't know that? Vadim did ...
> > >
> > > Didn't I mention a few times that I was
> > > inspired by Oracle? -:)
> >
> > How does it do MVCC with an overwriting storage manager ?
>
> 1. System Change Number (SCN) is used: system increments it
> on each transaction commit.
> 2. When scan meets data block with SCN > SCN as it was when
> query/transaction started, old block image is restored
> using rollback segments.
You mean it is restored in session that is running the transaction ?
I guess thet it could be slower than our current way of doing it.
> > Could it possibly be a Postgres-inspired bolted-on hack
> > needed for better concurrency ?
>
> -:)) Oracle has MVCC for years, probably from the beginning
> and for sure before Postgres.
In that case we can claim thet their way is more primitive ;) ;)
-----------------
Hannu
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly
From vmikheev@SECTORBASE.COM Fri May 25 12:38:38 2001
Return-path: <vmikheev@SECTORBASE.COM>
Received: from mailer.sectorbase.com (mailer.sectorbase.com [63.88.121.2])
by candle.pha.pa.us (8.10.1/8.10.1) with SMTP id f4PGcbt10779
for <pgman@candle.pha.pa.us>; Fri, 25 May 2001 12:38:38 -0400 (EDT)
Received: (qmail 95922 invoked by uid 503); 25 May 2001 16:38:29 -0000
Received: from sectorbase2.sectorbase.com (192.168.254.2)
by gate1.sectorbase.com with SMTP; 25 May 2001 16:38:29 -0000
Received: by sectorbase2.sectorbase.com with Internet Mail Service (5.5.2653.19)
id <LG3CDJAL>; Fri, 25 May 2001 09:37:16 -0700
Message-ID: <3705826352029646A3E91C53F7189E32016656@sectorbase2.sectorbase.com>
From: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>
To: "'Bruce Momjian'" <pgman@candle.pha.pa.us>,
Hiroshi Inoue
<Inoue@tpf.co.jp>
cc: Don Baccus <dhogaza@pacifier.com>, Tom Lane <tgl@sss.pgh.pa.us>,
"'Zeugswetter Andreas SB'" <ZeugswetterA@wien.spardat.at>,
The Hermit Hacker <scrappy@hub.org>, pgsql-hackers@postgresql.org
Subject: RE: [HACKERS] Plans for solving the VACUUM problem
Date: Fri, 25 May 2001 09:37:16 -0700
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
Content-Type: text/plain;
charset="iso-8859-1"
Status: OR
> Do we want to head for an overwriting storage manager?
>
> Not sure.
>
> Advantages: UPDATE has easy space reuse because usually done
> in-place, no index change on UPDATE unless key is changed.
>
> Disadvantages: Old records have to be stored somewhere for MVCC use.
> Could limit transaction size.
Really? Why is it assumed that we *must* limit size of rollback segments?
We can let them grow without bounds, as we do now keeping old records in
datafiles and letting them eat all of disk space.
> UNDO disadvantages are:
>
> Limit size of transactions to log storage size.
Don't be kidding - in any system transactions size is limitted
by available storage. So we should tell that more disk space
is required for UNDO. From my POV, putting $100 to buy 30Gb
disk is not big deal, keeping in mind that PGSQL requires
$ZERO to be used.
Vadim
From pgsql-hackers-owner+M9365@postgresql.org Fri May 25 13:11:43 2001
Return-path: <pgsql-hackers-owner+M9365@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4PHBht18086
for <pgman@candle.pha.pa.us>; Fri, 25 May 2001 13:11:43 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4PHBEA00999;
Fri, 25 May 2001 13:11:14 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9365@postgresql.org)
Received: from mailer.sectorbase.com (mailer.sectorbase.com [63.88.121.2])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4PGcXA86450
for <pgsql-hackers@postgresql.org>; Fri, 25 May 2001 12:38:33 -0400 (EDT)
(envelope-from vmikheev@SECTORBASE.COM)
Received: (qmail 95922 invoked by uid 503); 25 May 2001 16:38:29 -0000
Received: from sectorbase2.sectorbase.com (192.168.254.2)
by gate1.sectorbase.com with SMTP; 25 May 2001 16:38:29 -0000
Received: by sectorbase2.sectorbase.com with Internet Mail Service (5.5.2653.19)
id <LG3CDJAL>; Fri, 25 May 2001 09:37:16 -0700
Message-ID: <3705826352029646A3E91C53F7189E32016656@sectorbase2.sectorbase.com>
From: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>
To: "'Bruce Momjian'" <pgman@candle.pha.pa.us>,
Hiroshi Inoue
<Inoue@tpf.co.jp>
cc: Don Baccus <dhogaza@pacifier.com>, Tom Lane <tgl@sss.pgh.pa.us>,
"'Zeugswetter Andreas SB'" <ZeugswetterA@wien.spardat.at>,
The Hermit Hacker <scrappy@hub.org>, pgsql-hackers@postgresql.org
Subject: RE: [HACKERS] Plans for solving the VACUUM problem
Date: Fri, 25 May 2001 09:37:16 -0700
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
Content-Type: text/plain;
charset="iso-8859-1"
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
> Do we want to head for an overwriting storage manager?
>
> Not sure.
>
> Advantages: UPDATE has easy space reuse because usually done
> in-place, no index change on UPDATE unless key is changed.
>
> Disadvantages: Old records have to be stored somewhere for MVCC use.
> Could limit transaction size.
Really? Why is it assumed that we *must* limit size of rollback segments?
We can let them grow without bounds, as we do now keeping old records in
datafiles and letting them eat all of disk space.
> UNDO disadvantages are:
>
> Limit size of transactions to log storage size.
Don't be kidding - in any system transactions size is limitted
by available storage. So we should tell that more disk space
is required for UNDO. From my POV, putting $100 to buy 30Gb
disk is not big deal, keeping in mind that PGSQL requires
$ZERO to be used.
Vadim
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?
http://www.postgresql.org/search.mpl
From vmikheev@SECTORBASE.COM Fri May 25 13:06:50 2001
Return-path: <vmikheev@SECTORBASE.COM>
Received: from mailer.sectorbase.com (mailer.sectorbase.com [63.88.121.2])
by candle.pha.pa.us (8.10.1/8.10.1) with SMTP id f4PH6ot17912
for <pgman@candle.pha.pa.us>; Fri, 25 May 2001 13:06:50 -0400 (EDT)
Received: (qmail 5857 invoked by uid 503); 25 May 2001 17:06:45 -0000
Received: from sectorbase2.sectorbase.com (192.168.254.2)
by gate1.sectorbase.com with SMTP; 25 May 2001 17:06:45 -0000
Received: by sectorbase2.sectorbase.com with Internet Mail Service (5.5.2653.19)
id <LG3CDJCN>; Fri, 25 May 2001 10:05:32 -0700
Message-ID: <3705826352029646A3E91C53F7189E32016657@sectorbase2.sectorbase.com>
From: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>
To: "'Zeugswetter Andreas SB'" <ZeugswetterA@wien.spardat.at>,
"'Don Baccus'"
<dhogaza@pacifier.com>, Tom Lane <tgl@sss.pgh.pa.us>,
Hiroshi Inoue
<Inoue@tpf.co.jp>
cc: Bruce Momjian <pgman@candle.pha.pa.us>,
The Hermit Hacker
<scrappy@hub.org>, pgsql-hackers@postgresql.org
Subject: RE: [HACKERS] Plans for solving the VACUUM problem
Date: Fri, 25 May 2001 10:05:31 -0700
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
Content-Type: text/plain;
charset="iso-8859-1"
Status: OR
> > > >Oracle has MVCC?
> > >
> > > With restrictions, yes.
> >
> > What restrictions? Rollback segments size?
>
> No, that is not the whole story. The problem with their
> "rollback segment approach" is, that they do not guard against
> overwriting a tuple version in the rollback segment.
> They simply recycle each segment in a wrap around manner.
> Thus there could be an open transaction that still wanted to
> see a tuple version that was already overwritten, leading to the
> feared "snapshot too old" error.
>
> Copying their "rollback segment" approach is imho the last
> thing we want to do.
So, they limit size of rollback segments and we don't limit
how big our datafiles may grow if there is some long running
transaction in serializable mode. We could allow our rollback
segments to grow without limits as well.
> > Non-overwriting smgr can eat all disk space...
> >
> > > You didn't know that? Vadim did ...
> >
> > Didn't I mention a few times that I was inspired by Oracle? -:)
>
> Looking at what they supply in the feature area is imho good.
> Copying their technical architecture is not so good in general.
Copying is not inspiration -:)
Vadim
From pgsql-hackers-owner+M9367@postgresql.org Fri May 25 14:01:43 2001
Return-path: <pgsql-hackers-owner+M9367@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4PI1gt20100
for <pgman@candle.pha.pa.us>; Fri, 25 May 2001 14:01:42 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4PI1GA21327;
Fri, 25 May 2001 14:01:16 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9367@postgresql.org)
Received: from mailer.sectorbase.com (mailer.sectorbase.com [63.88.121.2])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4PHrVA17755
for <pgsql-hackers@postgresql.org>; Fri, 25 May 2001 13:53:31 -0400 (EDT)
(envelope-from vmikheev@SECTORBASE.COM)
Received: (qmail 15841 invoked by uid 503); 25 May 2001 17:53:30 -0000
Received: from sectorbase2.sectorbase.com (192.168.254.2)
by gate1.sectorbase.com with SMTP; 25 May 2001 17:53:30 -0000
Received: by sectorbase2.sectorbase.com with Internet Mail Service (5.5.2653.19)
id <LG3CDJF3>; Fri, 25 May 2001 10:52:17 -0700
Message-ID: <3705826352029646A3E91C53F7189E32016658@sectorbase2.sectorbase.com>
From: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>
To: "'Hannu Krosing'" <hannu@tm.ee>
cc: "'Don Baccus'" <dhogaza@pacifier.com>, Tom Lane <tgl@sss.pgh.pa.us>,
Hiroshi Inoue <Inoue@tpf.co.jp>, Bruce Momjian <pgman@candle.pha.pa.us>,
"'Zeugswetter Andreas SB'" <ZeugswetterA@wien.spardat.at>,
The Hermit Hacker <scrappy@hub.org>, pgsql-hackers@postgresql.org
Subject: RE: [HACKERS] Plans for solving the VACUUM problem
Date: Fri, 25 May 2001 10:52:17 -0700
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
Content-Type: text/plain;
charset="iso-8859-1"
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
> > Removing dead records from rollback segments should
> > be faster than from datafiles.
>
> Is it for better locality or are they stored in a different way ?
Locality - all dead data would be localized in one place.
> Do you think that there is some fundamental performance advantage
> in making a copy to rollback segment and then deleting it from
> there vs. reusing space in datafiles ?
As it showed by WAL additional writes don't mean worse performance.
As for deleting from RS (rollback segment) - we could remove or reuse
RS files as whole.
> > > How does it do MVCC with an overwriting storage manager ?
> >
> > 1. System Change Number (SCN) is used: system increments it
> > on each transaction commit.
> > 2. When scan meets data block with SCN > SCN as it was when
> > query/transaction started, old block image is restored
> > using rollback segments.
>
> You mean it is restored in session that is running the transaction ?
>
> I guess thet it could be slower than our current way of doing it.
Yes, for older transactions which *really* need in *particular*
old data, but not for newer ones. Look - now transactions have to read
dead data again and again, even if some of them (newer) need not to see
those data at all, and we keep dead data as long as required for other
old transactions *just for the case* they will look there.
But who knows?! Maybe those old transactions will not read from table
with big amount of dead data at all! So - why keep dead data in datafiles
for long time? This obviously affects overall system performance.
Vadim
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
From pgsql-hackers-owner+M9387@postgresql.org Sun May 27 04:42:32 2001
Return-path: <pgsql-hackers-owner+M9387@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4R8gVa22868
for <pgman@candle.pha.pa.us>; Sun, 27 May 2001 04:42:32 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4R8fwA13840;
Sun, 27 May 2001 04:41:58 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9387@postgresql.org)
Received: from p2272.nsk.ne.jp (p2272.nsk.ne.jp [210.145.18.145])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4R8YeA10972
for <pgsql-hackers@postgresql.org>; Sun, 27 May 2001 04:34:41 -0400 (EDT)
(envelope-from Inoue@tpf.co.jp)
Received: from mcadnote1 (ppm147.noc.fukui.nsk.ne.jp [210.161.188.66])
by p2272.nsk.ne.jp (8.9.3/3.7W-20000722) with SMTP id RAA11130;
Sun, 27 May 2001 17:32:07 +0900 (JST)
From: "Hiroshi Inoue" <Inoue@tpf.co.jp>
To: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>,
"'Bruce Momjian'" <pgman@candle.pha.pa.us>
cc: "Don Baccus" <dhogaza@pacifier.com>, "Tom Lane" <tgl@sss.pgh.pa.us>,
"'Zeugswetter Andreas SB'" <ZeugswetterA@wien.spardat.at>,
"The Hermit Hacker" <scrappy@hub.org>, <pgsql-hackers@postgresql.org>
Subject: RE: [HACKERS] Plans for solving the VACUUM problem
Date: Sun, 27 May 2001 17:32:54 +0900
Message-ID: <EKEJJICOHDIEMGPNIFIJKEEBEIAA.Inoue@tpf.co.jp>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700
Importance: Normal
In-Reply-To: <3705826352029646A3E91C53F7189E32016656@sectorbase2.sectorbase.com>
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
> -----Original Message-----
> From: Mikheev, Vadim [mailto:vmikheev@SECTORBASE.COM]
>
> > Do we want to head for an overwriting storage manager?
> >
> > Not sure.
> >
> > Advantages: UPDATE has easy space reuse because usually done
> > in-place, no index change on UPDATE unless key is changed.
> >
> > Disadvantages: Old records have to be stored somewhere for MVCC use.
> > Could limit transaction size.
>
> Really? Why is it assumed that we *must* limit size of rollback segments?
> We can let them grow without bounds, as we do now keeping old records in
> datafiles and letting them eat all of disk space.
>
Is it proper/safe for a DBMS to allow the system eating all disk
space ? For example, could we expect to recover the database
even when no disk space available ?
1) even before WAL
Is 'deleting records and vacuum' always possible ?
I saw the cases that indexes grow by vacuum.
2) under WAL(current)
If DROP or VACUUM is done after a checkpoint, wouldn't
REDO recovery add the pages drop/truncated by the
DROP/VACUUM ?
3) with rollback data
Shouldn't WAL log UNDO operations either ?
If so, UNDO requires an extra disk space which could
be unlimitedly big.
There's another serious problem. Once UNDO is required
with a biiiig rollback data, it would take a veeery long time
to undo. It's quite different from the current behavior. Even
though people want to cancel the UNDO, there's no way
unfortunately(under an overwriting smgr).
regards,
Hiroshi Inoue
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
From vmikheev@sectorbase.com Mon May 28 13:11:10 2001
Return-path: <vmikheev@sectorbase.com>
Received: from mailer.sectorbase.com (mailer.sectorbase.com [63.88.121.2])
by candle.pha.pa.us (8.10.1/8.10.1) with SMTP id f4SHB9g28092
for <pgman@candle.pha.pa.us>; Mon, 28 May 2001 13:11:09 -0400 (EDT)
Received: (qmail 21667 invoked by uid 503); 28 May 2001 17:11:03 -0000
Received: from din4.sectorbase.com (HELO dune) (63.88.121.74)
by gate1.sectorbase.com with SMTP; 28 May 2001 17:11:03 -0000
Message-ID: <007001c0e799$321dcc00$4a79583f@sectorbase.com>
From: "Vadim Mikheev" <vmikheev@sectorbase.com>
To: "Zeugswetter Andreas SB" <ZeugswetterA@wien.spardat.at>,
"'Hannu Krosing'" <hannu@tm.ee>
cc: "'Don Baccus'" <dhogaza@pacifier.com>, "Tom Lane" <tgl@sss.pgh.pa.us>,
"Hiroshi Inoue" <Inoue@tpf.co.jp>, "Bruce Momjian" <pgman@candle.pha.pa.us>,
"The Hermit Hacker" <scrappy@hub.org>, <pgsql-hackers@postgresql.org>
References: <11C1E6749A55D411A9670001FA6879633682F5@sdexcsrv1.f000.d0188.sd.spardat.at>
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
Date: Mon, 28 May 2001 10:11:10 -0700
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
Status: OR
> Yes, that is a good description. And old version is only required in the following
> two cases:
>
> 1. the txn that modified this tuple is still open (reader in default committed read)
> 2. reader is in serializable transaction isolation and has earlier xtid
>
> Seems overwrite smgr has mainly advantages in terms of speed for operations
> other than rollback.
... And rollback is required for < 5% transactions ...
Vadim
From hannu@tm.ee Mon May 28 13:37:50 2001
Return-path: <hannu@tm.ee>
Received: from taru.tm.ee (taru.tm.ee [194.204.62.23])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4SHblg17386
for <pgman@candle.pha.pa.us>; Mon, 28 May 2001 13:37:48 -0400 (EDT)
Received: from tm.ee (localhost.localdomain [127.0.0.1])
by taru.tm.ee (8.11.2/8.11.2) with ESMTP id f4SHfeI11208;
Mon, 28 May 2001 19:41:40 +0200
Sender: hannu@taru.tm.ee
Message-ID: <3B128DD4.E15100AB@tm.ee>
Date: Mon, 28 May 2001 19:41:40 +0200
From: Hannu Krosing <hannu@tm.ee>
X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.4.2-2 i686)
X-Accept-Language: et, en, ru
MIME-Version: 1.0
To: Vadim Mikheev <vmikheev@sectorbase.com>
cc: Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>,
"'Don Baccus'" <dhogaza@pacifier.com>, Tom Lane <tgl@sss.pgh.pa.us>,
Hiroshi Inoue <Inoue@tpf.co.jp>, Bruce Momjian <pgman@candle.pha.pa.us>,
The Hermit Hacker <scrappy@hub.org>, pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
References: <11C1E6749A55D411A9670001FA6879633682F5@sdexcsrv1.f000.d0188.sd.spardat.at> <007001c0e799$321dcc00$4a79583f@sectorbase.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Status: OR
Vadim Mikheev wrote:
>
> > Yes, that is a good description. And old version is only required in the following
> > two cases:
> >
> > 1. the txn that modified this tuple is still open (reader in default committed read)
> > 2. reader is in serializable transaction isolation and has earlier xtid
> >
> > Seems overwrite smgr has mainly advantages in terms of speed for operations
> > other than rollback.
>
> ... And rollback is required for < 5% transactions ...
This obviously depends on application.
I know people who rollback most of their transactions (actually they use
it to
emulate temp tables when reporting).
OTOH it is possible to do without rolling back at all as MySQL folks
have
shown us ;)
Also, IIRC, pgbench does no rollbacks. I think that we have no
performance test that does.
-----------------
Hannu
From pgsql-hackers-owner+M9464@postgresql.org Tue May 29 16:40:30 2001
Return-path: <pgsql-hackers-owner+M9464@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4TKeU722464
for <pgman@candle.pha.pa.us>; Tue, 29 May 2001 16:40:30 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4TKe3E85183;
Tue, 29 May 2001 16:40:03 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9464@postgresql.org)
Received: from rh72.home.ee (adsl895.estpak.ee [213.168.23.133])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4TKBxE74107
for <pgsql-hackers@postgresql.org>; Tue, 29 May 2001 16:11:59 -0400 (EDT)
(envelope-from hannu@tm.ee)
Received: from tm.ee (rh72.home.ee [127.0.0.1])
by rh72.home.ee (8.11.2/8.11.2) with ESMTP id f4TH7H501651;
Tue, 29 May 2001 22:07:18 +0500
Message-ID: <3B13D744.10537597@tm.ee>
Date: Tue, 29 May 2001 22:07:16 +0500
From: Hannu Krosing <hannu@tm.ee>
X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.4.2-2 i686)
X-Accept-Language: en, ru, et
MIME-Version: 1.0
To: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>
cc: Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>,
"'Don Baccus'" <dhogaza@pacifier.com>, Tom Lane <tgl@sss.pgh.pa.us>,
Hiroshi Inoue <Inoue@tpf.co.jp>, Bruce Momjian <pgman@candle.pha.pa.us>,
The Hermit Hacker <scrappy@hub.org>, pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Plans for solving the VACUUM problem
References: <3705826352029646A3E91C53F7189E3201665D@sectorbase2.sectorbase.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
"Mikheev, Vadim" wrote:
>
> > I know people who rollback most of their transactions
> > (actually they use it to emulate temp tables when reporting).
>
> Shouldn't they use TEMP tables? -:)
They probably should.
Actually they did it on Oracle, so it shows that it can be done
even with O-smgr ;)
> > OTOH it is possible to do without rolling back at all as
> > MySQL folks have shown us ;)
>
> Not with SDB tables which support transactions.
My point was that MySQL was used quite a long time without it
and still quite many useful applications were produced.
BTW, do you know what strategy is used by BSDDB/SDB for
rollback/undo ?
---------------
Hannu
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
From vmikheev@SECTORBASE.COM Tue May 29 13:50:48 2001
Return-path: <vmikheev@SECTORBASE.COM>
Received: from mailer.sectorbase.com (mailer.sectorbase.com [63.88.121.2])
by candle.pha.pa.us (8.10.1/8.10.1) with SMTP id f4THol712186
for <pgman@candle.pha.pa.us>; Tue, 29 May 2001 13:50:47 -0400 (EDT)
Received: (qmail 35525 invoked by uid 503); 29 May 2001 17:50:38 -0000
Received: from sectorbase2.sectorbase.com (192.168.254.2)
by gate1.sectorbase.com with SMTP; 29 May 2001 17:50:38 -0000
Received: by sectorbase2.sectorbase.com with Internet Mail Service (5.5.2653.19)
id <LG3CDR7P>; Tue, 29 May 2001 10:49:12 -0700
Message-ID: <3705826352029646A3E91C53F7189E3201665D@sectorbase2.sectorbase.com>
From: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>
To: "'Hannu Krosing'" <hannu@tm.ee>
cc: Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>,
"'Don Baccus'"
<dhogaza@pacifier.com>, Tom Lane <tgl@sss.pgh.pa.us>,
Hiroshi Inoue
<Inoue@tpf.co.jp>, Bruce Momjian <pgman@candle.pha.pa.us>,
The Hermit Hacker <scrappy@hub.org>, pgsql-hackers@postgresql.org
Subject: RE: [HACKERS] Plans for solving the VACUUM problem
Date: Tue, 29 May 2001 10:49:12 -0700
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
Content-Type: text/plain;
charset="iso-8859-1"
Status: OR
> > > Seems overwrite smgr has mainly advantages in terms of
> > > speed for operations other than rollback.
> >
> > ... And rollback is required for < 5% transactions ...
>
> This obviously depends on application.
Small number of aborted transactions was used to show
useless of UNDO in terms of space cleanup - that's why
I use same argument to show usefulness of O-smgr -:)
> I know people who rollback most of their transactions
> (actually they use it to emulate temp tables when reporting).
Shouldn't they use TEMP tables? -:)
> OTOH it is possible to do without rolling back at all as
> MySQL folks have shown us ;)
Not with SDB tables which support transactions.
Vadim
From pgsql-hackers-owner+M9462@postgresql.org Tue May 29 14:12:23 2001
Return-path: <pgsql-hackers-owner+M9462@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4TICN713882
for <pgman@candle.pha.pa.us>; Tue, 29 May 2001 14:12:23 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4TIBvE28866;
Tue, 29 May 2001 14:11:57 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9462@postgresql.org)
Received: from comet.pacifier.com (comet.pacifier.com [199.2.117.155])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4THvaE21886
for <pgsql-hackers@postgresql.org>; Tue, 29 May 2001 13:57:36 -0400 (EDT)
(envelope-from dhogaza@pacifier.com)
Received: from desktop (dsl-dhogaza.pacifier.net [207.202.226.68])
by comet.pacifier.com (8.11.2/8.11.1) with SMTP id f4THtri06016;
Tue, 29 May 2001 10:55:57 -0700 (PDT)
Message-ID: <3.0.1.32.20010529105533.016b9100@mail.pacifier.com>
X-Sender: dhogaza@mail.pacifier.com
X-Mailer: Windows Eudora Pro Version 3.0.1 (32)
Date: Tue, 29 May 2001 10:55:33 -0700
To: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>,
"'Hannu Krosing'" <hannu@tm.ee>
From: Don Baccus <dhogaza@pacifier.com>
Subject: RE: [HACKERS] Plans for solving the VACUUM problem
cc: Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>,
Tom Lane <tgl@sss.pgh.pa.us>, Hiroshi Inoue <Inoue@tpf.co.jp>,
Bruce Momjian <pgman@candle.pha.pa.us>, The Hermit Hacker <scrappy@hub.org>,
pgsql-hackers@postgresql.org
In-Reply-To: <3705826352029646A3E91C53F7189E3201665D@sectorbase2.sectorb
ase.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
At 10:49 AM 5/29/01 -0700, Mikheev, Vadim wrote:
>> I know people who rollback most of their transactions
>> (actually they use it to emulate temp tables when reporting).
>
>Shouldn't they use TEMP tables? -:)
Which is a very good point. Pandering to poor practice at the
expense of good performance for better-designed applications
isn't a good idea.
- Don Baccus, Portland OR <dhogaza@pacifier.com>
Nature photos, on-line guides, Pacific Northwest
Rare Bird Alert Service and other goodies at
http://donb.photo.net.
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/users-lounge/docs/faq.html
From pgsql-hackers-owner+M9466@postgresql.org Tue May 29 17:15:46 2001
Return-path: <pgsql-hackers-owner+M9466@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4TLFk725188
for <pgman@candle.pha.pa.us>; Tue, 29 May 2001 17:15:46 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4TLFLE98211;
Tue, 29 May 2001 17:15:21 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9466@postgresql.org)
Received: from mailer.sectorbase.com (mailer.sectorbase.com [63.88.121.2])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4TKcWE84385
for <pgsql-hackers@postgresql.org>; Tue, 29 May 2001 16:38:32 -0400 (EDT)
(envelope-from vmikheev@SECTORBASE.COM)
Received: (qmail 71617 invoked by uid 503); 29 May 2001 20:38:31 -0000
Received: from sectorbase2.sectorbase.com (192.168.254.2)
by gate1.sectorbase.com with SMTP; 29 May 2001 20:38:31 -0000
Received: by sectorbase2.sectorbase.com with Internet Mail Service (5.5.2653.19)
id <LG3CDSJA>; Tue, 29 May 2001 13:37:04 -0700
Message-ID: <3705826352029646A3E91C53F7189E32016660@sectorbase2.sectorbase.com>
From: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>
To: "'Hannu Krosing'" <hannu@tm.ee>
cc: Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>,
"'Don Baccus'"
<dhogaza@pacifier.com>, Tom Lane <tgl@sss.pgh.pa.us>,
Hiroshi Inoue
<Inoue@tpf.co.jp>, Bruce Momjian <pgman@candle.pha.pa.us>,
The Hermit Hacker <scrappy@hub.org>, pgsql-hackers@postgresql.org
Subject: RE: [HACKERS] Plans for solving the VACUUM problem
Date: Tue, 29 May 2001 13:37:03 -0700
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
Content-Type: text/plain;
charset="iso-8859-1"
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
> > > OTOH it is possible to do without rolling back at all as
> > > MySQL folks have shown us ;)
> >
> > Not with SDB tables which support transactions.
>
> My point was that MySQL was used quite a long time without it
> and still quite many useful applications were produced.
And my point was that needless to talk about rollbacks in
non-transaction system and in transaction system one has to
implement rollback somehow.
> BTW, do you know what strategy is used by BSDDB/SDB for
> rollback/undo ?
AFAIR, they use O-smgr => UNDO is required.
Vadim
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
From pgsql-hackers-owner+M9119@postgresql.org Mon May 21 13:38:38 2001
Return-path: <pgsql-hackers-owner+M9119@postgresql.org>
Received: from west.navpoint.com (root@west.navpoint.com [207.106.42.13])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4LHccQ02858
for <pgman@candle.pha.pa.us>; Mon, 21 May 2001 13:38:38 -0400 (EDT)
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by west.navpoint.com (8.11.3/8.10.1) with ESMTP id f4LFCNv10580
for <pgman@candle.pha.pa.us>; Mon, 21 May 2001 11:12:23 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4LF5AA60093;
Mon, 21 May 2001 11:05:10 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9119@postgresql.org)
Received: from reorxrsm.server.lan.at (zep3.it-austria.net [213.150.1.73])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4LEj6A50541
for <pgsql-hackers@postgresql.org>; Mon, 21 May 2001 10:45:07 -0400 (EDT)
(envelope-from ZeugswetterA@wien.spardat.at)
Received: from gz0153.gc.spardat.at (gz0153.gc.spardat.at [172.20.10.149])
by reorxrsm.server.lan.at (8.11.2/8.11.2) with ESMTP id f4LEj0930147
for <pgsql-hackers@postgresql.org>; Mon, 21 May 2001 16:45:00 +0200
Received: by sdexcgtw01.f000.d0188.sd.spardat.at with Internet Mail Service (5.5.2650.21)
id <K5WGS6NA>; Mon, 21 May 2001 16:44:44 +0200
Message-ID: <11C1E6749A55D411A9670001FA6879633682DA@sdexcsrv1.f000.d0188.sd.spardat.at>
From: Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>
To: "'Mikheev, Vadim'" <vmikheev@SECTORBASE.COM>,
"'Bruce Momjian'"
<pgman@candle.pha.pa.us>
cc: "'Tom Lane'" <tgl@sss.pgh.pa.us>, pgsql-hackers@postgresql.org
Subject: AW: [HACKERS] Plans for solving the VACUUM problem
Date: Mon, 21 May 2001 16:44:42 +0200
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.21)
Content-Type: text/plain;
charset="iso-8859-1"
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
> > Vadim, can you remind me what UNDO is used for?
> 4. Split pg_log into small files with ability to remove old ones (which
> do not hold statuses for any running transactions).
They are already small (16Mb). Or do you mean even smaller ?
This imposes one huge risk, that is already a pain in other db's. You need
all logs of one transaction online. For a GigaByte transaction like a bulk
insert this can be very inconvenient.
Imho there should be some limit where you can choose whether you want
to continue without the feature (no savepoint) or are automatically aborted.
In any case, imho some thought should be put into this :-)
Another case where this is a problem is a client that starts a tx, does one little
insert or update on his private table, and then sits and waits for a day.
Both cases currently impose no problem whatsoever.
Andreas
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
From ZeugswetterA@wien.spardat.at Mon May 21 13:37:56 2001
Return-path: <ZeugswetterA@wien.spardat.at>
Received: from west.navpoint.com (root@west.navpoint.com [207.106.42.13])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4LHbuQ02280
for <pgman@candle.pha.pa.us>; Mon, 21 May 2001 13:37:56 -0400 (EDT)
Received: from reorxrsm.server.lan.at (zep3.it-austria.net [213.150.1.73])
by west.navpoint.com (8.11.3/8.10.1) with ESMTP id f4LGPOv03505
for <pgman@candle.pha.pa.us>; Mon, 21 May 2001 12:25:24 -0400 (EDT)
Received: from gz0153.gc.spardat.at (gz0153.gc.spardat.at [172.20.10.149])
by reorxrsm.server.lan.at (8.11.2/8.11.2) with ESMTP id f4LGC8921002
for <pgman@candle.pha.pa.us>; Mon, 21 May 2001 18:12:08 +0200
Received: by sdexcgtw01.f000.d0188.sd.spardat.at with Internet Mail Service (5.5.2650.21)
id <K5WGS694>; Mon, 21 May 2001 18:11:26 +0200
Message-ID: <11C1E6749A55D411A9670001FA6879633682E2@sdexcsrv1.f000.d0188.sd.spardat.at>
From: Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>
To: "'Vadim Mikheev'" <vmikheev@SECTORBASE.COM>,
The Hermit Hacker
<scrappy@hub.org>
cc: Tom Lane <tgl@sss.pgh.pa.us>, "'Bruce Momjian'" <pgman@candle.pha.pa.us>,
pgsql-hackers@postgresql.org
Subject: AW: [HACKERS] Plans for solving the VACUUM problem
Date: Mon, 21 May 2001 18:11:16 +0200
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.21)
Content-Type: text/plain;
charset="iso-8859-1"
Status: OR
> My point is that we'll need in dynamic cleanup anyway and UNDO is
> what should be implemented for dynamic cleanup of aborted changes.
I do not yet understand why you want to handle aborts different than outdated
tuples. The ratio in a well tuned system should well favor outdated tuples.
If someone ever adds "dirty read" it is also not the case that it is guaranteed,
that nobody accesses the tuple you currently want to undo. So I really miss to see
the big difference.
Andreas
From pgsql-hackers-owner+M9153@postgresql.org Mon May 21 16:27:39 2001
Return-path: <pgsql-hackers-owner+M9153@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4LKRdQ22261
for <pgman@candle.pha.pa.us>; Mon, 21 May 2001 16:27:39 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4LKPaA50766;
Mon, 21 May 2001 16:25:36 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9153@postgresql.org)
Received: from ns.sharemation.com (h-64-105-36-191.snvacaid.covad.net [64.105.36.191])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4LKKZA48741
for <pgsql-hackers@postgresql.org>; Mon, 21 May 2001 16:20:35 -0400 (EDT)
(envelope-from barry@xythos.com)
Received: from xythos.com ([192.168.254.19])
by ns.sharemation.com (8.9.3/8.8.7) with ESMTP id MAA32032;
Mon, 21 May 2001 12:05:12 -0700
Message-ID: <3B09783C.1080508@xythos.com>
Date: Mon, 21 May 2001 13:19:08 -0700
From: Barry Lind <barry@xythos.com>
User-Agent: Mozilla/5.0 (X11; U; Linux 2.2.16-22 i686; en-US; m18) Gecko/20010131 Netscape6/6.01
X-Accept-Language: en
MIME-Version: 1.0
To: Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>,
pgsql-hackers@postgresql.org
Subject: Re: AW: [HACKERS] Plans for solving the VACUUM problem
References: <11C1E6749A55D411A9670001FA6879633682DA@sdexcsrv1.f000.d0188.sd.spardat.at>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
Zeugswetter Andreas SB wrote:
>>> Vadim, can you remind me what UNDO is used for?
>>
>> 4. Split pg_log into small files with ability to remove old ones (which
>> do not hold statuses for any running transactions).
>
>
> They are already small (16Mb). Or do you mean even smaller ?
> This imposes one huge risk, that is already a pain in other db's. You need
> all logs of one transaction online. For a GigaByte transaction like a bulk
> insert this can be very inconvenient.
> Imho there should be some limit where you can choose whether you want
> to continue without the feature (no savepoint) or are automatically aborted.
>
> In any case, imho some thought should be put into this :-)
>
> Another case where this is a problem is a client that starts a tx, does one little
> insert or update on his private table, and then sits and waits for a day.
>
> Both cases currently impose no problem whatsoever.
Correct me if I am wrong, but both cases do present a problem currently
in 7.1. The WAL log will not remove any WAL files for transactions that
are still open (even after a checkpoint occurs). Thus if you do a bulk
insert of gigabyte size you will require a gigabyte sized WAL
directory. Also if you have a simple OLTP transaction that the user
started and walked away from for his one week vacation, then no WAL log
files can be deleted until that user returns from his vacation and ends
his transaction.
--Barry
>
>
> Andreas
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>
>
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/users-lounge/docs/faq.html
From pgsql-hackers-owner+M9154@postgresql.org Mon May 21 16:45:07 2001
Return-path: <pgsql-hackers-owner+M9154@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4LKj7Q24731
for <pgman@candle.pha.pa.us>; Mon, 21 May 2001 16:45:07 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4LKhDA57568;
Mon, 21 May 2001 16:43:13 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9154@postgresql.org)
Received: from mailer.sectorbase.com (mailer.sectorbase.com [63.88.121.2])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4LKU6A52602
for <pgsql-hackers@postgresql.org>; Mon, 21 May 2001 16:30:06 -0400 (EDT)
(envelope-from vmikheev@SECTORBASE.COM)
Received: (qmail 65246 invoked by uid 503); 21 May 2001 20:30:04 -0000
Received: from sectorbase2.sectorbase.com (192.168.254.2)
by gate1.sectorbase.com with SMTP; 21 May 2001 20:30:04 -0000
Received: by sectorbase2.sectorbase.com with Internet Mail Service (5.5.2653.19)
id <LG3CC6JW>; Mon, 21 May 2001 13:29:04 -0700
Message-ID: <3705826352029646A3E91C53F7189E3201663C@sectorbase2.sectorbase.com>
From: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>
To: "'Barry Lind'" <barry@xythos.com>,
Zeugswetter Andreas SB
<ZeugswetterA@wien.spardat.at>,
pgsql-hackers@postgresql.org
Subject: RE: AW: [HACKERS] Plans for solving the VACUUM problem
Date: Mon, 21 May 2001 13:29:03 -0700
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
Content-Type: text/plain;
charset="iso-8859-1"
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
> Correct me if I am wrong, but both cases do present a problem
> currently in 7.1. The WAL log will not remove any WAL files
> for transactions that are still open (even after a checkpoint
> occurs). Thus if you do a bulk insert of gigabyte size you will
> require a gigabyte sized WAL directory. Also if you have a simple
> OLTP transaction that the user started and walked away from for
> his one week vacation, then no WAL log files can be deleted until
> that user returns from his vacation and ends his transaction.
Todo:
1. Compact log files after checkpoint (save records of uncommitted
transactions and remove/archive others).
2. Abort long running transactions.
Vadim
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
From pgsql-hackers-owner+M9155@postgresql.org Mon May 21 17:01:45 2001
Return-path: <pgsql-hackers-owner+M9155@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4LL1jQ27771
for <pgman@candle.pha.pa.us>; Mon, 21 May 2001 17:01:45 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4LKttA62549;
Mon, 21 May 2001 16:55:55 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9155@postgresql.org)
Received: from smtp018.mail.yahoo.com (smtp018.mail.yahoo.com [216.136.174.115])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4LKcbA55747
for <pgsql-hackers@postgresql.org>; Mon, 21 May 2001 16:38:37 -0400 (EDT)
(envelope-from janwieck@yahoo.com)
Received: from jupiter.us.greatbridge.com (HELO jupiter.jw.home) (65.196.69.55)
by smtp.mail.vip.sc5.yahoo.com with SMTP; 21 May 2001 20:38:35 -0000
X-Apparently-From: <janwieck@yahoo.com>
Received: (from janwieck@localhost)
by jupiter.jw.home (8.9.3/8.9.3) id QAA15136;
Mon, 21 May 2001 16:41:33 -0400
From: Jan Wieck <JanWieck@Yahoo.com>
Message-ID: <200105212041.QAA15136@jupiter.jw.home>
Subject: Re: AW: [HACKERS] Plans for solving the VACUUM problem
In-Reply-To: <3B09783C.1080508@xythos.com> from Barry Lind at "May 21, 2001 01:19:08
pm"
To: Barry Lind <barry@xythos.com>
Date: Mon, 21 May 2001 16:41:33 -0400 (EDT)
cc: Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>,
pgsql-hackers@postgresql.org
X-Mailer: ELM [version 2.4ME+ PL68 (25)]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
Barry Lind wrote:
>
>
> Zeugswetter Andreas SB wrote:
>
> >>> Vadim, can you remind me what UNDO is used for?
> >>
> >> 4. Split pg_log into small files with ability to remove old ones (which
> >> do not hold statuses for any running transactions).
> >
> >
> > They are already small (16Mb). Or do you mean even smaller ?
> > This imposes one huge risk, that is already a pain in other db's. You need
> > all logs of one transaction online. For a GigaByte transaction like a bulk
> > insert this can be very inconvenient.
> > Imho there should be some limit where you can choose whether you want
> > to continue without the feature (no savepoint) or are automatically aborted.
> >
> > In any case, imho some thought should be put into this :-)
> >
> > Another case where this is a problem is a client that starts a tx, does one little
> > insert or update on his private table, and then sits and waits for a day.
> >
> > Both cases currently impose no problem whatsoever.
>
> Correct me if I am wrong, but both cases do present a problem currently
> in 7.1. The WAL log will not remove any WAL files for transactions that
> are still open (even after a checkpoint occurs). Thus if you do a bulk
> insert of gigabyte size you will require a gigabyte sized WAL
> directory. Also if you have a simple OLTP transaction that the user
> started and walked away from for his one week vacation, then no WAL log
> files can be deleted until that user returns from his vacation and ends
> his transaction.
As a rule of thumb, online applications that hold open
transactions during user interaction are considered to be
Broken By Design (tm). So I'd slap the programmer/design
team with - let's use the server box since it doesn't contain
anything useful.
Jan
--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck@Yahoo.com #
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
From pgsql-hackers-owner+M9174@postgresql.org Tue May 22 04:34:56 2001
Return-path: <pgsql-hackers-owner+M9174@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4M8YuQ08718
for <pgman@candle.pha.pa.us>; Tue, 22 May 2001 04:34:56 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4M8VjA29342;
Tue, 22 May 2001 04:31:45 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9174@postgresql.org)
Received: from reorxrsm.server.lan.at (zep3.it-austria.net [213.150.1.73])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4M8GWA21819
for <pgsql-hackers@postgresql.org>; Tue, 22 May 2001 04:16:32 -0400 (EDT)
(envelope-from ZeugswetterA@wien.spardat.at)
Received: from gz0153.gc.spardat.at (gz0153.gc.spardat.at [172.20.10.149])
by reorxrsm.server.lan.at (8.11.2/8.11.2) with ESMTP id f4M8GSP18677
for <pgsql-hackers@postgresql.org>; Tue, 22 May 2001 10:16:28 +0200
Received: by sdexcgtw01.f000.d0188.sd.spardat.at with Internet Mail Service (5.5.2650.21)
id <K5WGS0WK>; Tue, 22 May 2001 10:16:10 +0200
Message-ID: <11C1E6749A55D411A9670001FA6879633682E8@sdexcsrv1.f000.d0188.sd.spardat.at>
From: Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>
To: "'Barry Lind'" <barry@xythos.com>, Tom Lane <tgl@sss.pgh.pa.us>
cc: pgsql-hackers@postgresql.org
Subject: AW: [HACKERS] Plans for solving the VACUUM problem
Date: Tue, 22 May 2001 10:16:10 +0200
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.21)
Content-Type: text/plain;
charset="iso-8859-1"
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
> REDO in oracle is done by something known as a 'rollback segment'.
You are not seriously saying that you like the "rollback segments" in Oracle.
They only cause trouble:
1. configuration (for every different workload you need a different config)
2. snapshot too old
3. tx abort because rollback segments are full
4. They use up huge amounts of space (e.g. 20 Gb rollback seg for a 120 Gb SAP)
If I read the papers correctly Version 9 gets rid of Point 1 but the rest ...
Andreas
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly
From pgsql-hackers-owner+M9206@postgresql.org Tue May 22 13:26:46 2001
Return-path: <pgsql-hackers-owner+M9206@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4MHQkQ08668
for <pgman@candle.pha.pa.us>; Tue, 22 May 2001 13:26:46 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4MHPBA80339;
Tue, 22 May 2001 13:25:11 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9206@postgresql.org)
Received: from ns.sharemation.com (h-64-105-36-191.snvacaid.covad.net [64.105.36.191])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4MHD8A75168
for <pgsql-hackers@postgresql.org>; Tue, 22 May 2001 13:13:09 -0400 (EDT)
(envelope-from barry@xythos.com)
Received: from xythos.com ([192.168.254.19])
by ns.sharemation.com (8.9.3/8.8.7) with ESMTP id IAA12961;
Tue, 22 May 2001 08:57:47 -0700
Message-ID: <3B0A9DD6.7040502@xythos.com>
Date: Tue, 22 May 2001 10:11:50 -0700
From: Barry Lind <barry@xythos.com>
User-Agent: Mozilla/5.0 (X11; U; Linux 2.2.16-22 i686; en-US; m18) Gecko/20010131 Netscape6/6.01
X-Accept-Language: en
MIME-Version: 1.0
To: Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>
cc: pgsql-hackers@postgresql.org
Subject: Re: AW: [HACKERS] Plans for solving the VACUUM problem
References: <11C1E6749A55D411A9670001FA6879633682E8@sdexcsrv1.f000.d0188.sd.spardat.at>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
Actually I don't like the problems with rollback segments in oracle at
all. I am just concerned that using WAL for UNDO will have all of the
same problems if it isn't designed carefully. At least in oracle's
rollback segments there are multiple of them, in WAL there is just one,
thus you will potentially have that 20Gig all in your single log
directory. People are already reporting the log directory growing to a
gig or more when running vacuum in 7.1.
Of the points you raised about oracle's rollback segment problems:
1. configuration (for every different workload you need a different config)
Postgres should be able to do a better job here.
2. snapshot too old
Shouldn't be a problem as long as postgres continues to use a non-overwriting storage manager. However under an overwriting storage manager, you need to keep all of the changes in the UNDO records to satisfy the query snapshot, thus if you want to limit the size of UNDO you may need to kill long running queries.
3. tx abort because rollback segments are full
If you want to limit the size of the UNDO, then this is a corresponding
byproduct. I believe a mail note was sent out yesterday suggesting that
limits like this be added to the todo list.
4. They use up huge amounts of space (e.g. 20 Gb rollback seg for a 120 Gb SAP)
You need to store the UNDO information somewhere. And on active
databases that can amount to alot of information, especially for bulk
loads or massive updates.
thanks,
--Barry
Zeugswetter Andreas SB wrote:
>
>
>> REDO in oracle is done by something known as a 'rollback segment'.
>
>
> You are not seriously saying that you like the "rollback segments" in Oracle.
> They only cause trouble:
> 1. configuration (for every different workload you need a different config)
> 2. snapshot too old
> 3. tx abort because rollback segments are full
> 4. They use up huge amounts of space (e.g. 20 Gb rollback seg for a 120 Gb SAP)
>
> If I read the papers correctly Version 9 gets rid of Point 1 but the rest ...
>
> Andreas
>
>
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
From pgsql-hackers-owner+M9210@postgresql.org Tue May 22 14:56:54 2001
Return-path: <pgsql-hackers-owner+M9210@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4MIurQ18060
for <pgman@candle.pha.pa.us>; Tue, 22 May 2001 14:56:53 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4MItuA22196;
Tue, 22 May 2001 14:55:56 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9210@postgresql.org)
Received: from mailer.sectorbase.com (mailer.sectorbase.com [63.88.121.2])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4MILiA06054
for <pgsql-hackers@postgresql.org>; Tue, 22 May 2001 14:21:45 -0400 (EDT)
(envelope-from vmikheev@SECTORBASE.COM)
Received: (qmail 26740 invoked by uid 503); 22 May 2001 18:21:43 -0000
Received: from sectorbase2.sectorbase.com (192.168.254.2)
by gate1.sectorbase.com with SMTP; 22 May 2001 18:21:43 -0000
Received: by sectorbase2.sectorbase.com with Internet Mail Service (5.5.2653.19)
id <LG3CC9XB>; Tue, 22 May 2001 11:20:40 -0700
Message-ID: <3705826352029646A3E91C53F7189E32016642@sectorbase2.sectorbase.com>
From: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>
To: "'Zeugswetter Andreas SB'" <ZeugswetterA@wien.spardat.at>,
"'Tom Lane'"
<tgl@sss.pgh.pa.us>
cc: pgsql-hackers@postgresql.org
Subject: RE: AW: [HACKERS] Plans for solving the VACUUM problem
Date: Tue, 22 May 2001 11:20:37 -0700
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
Content-Type: text/plain;
charset="iso-8859-1"
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
> > 1. Compact log files after checkpoint (save records of uncommitted
> > transactions and remove/archive others).
>
> On the grounds that undo is not guaranteed anyway (concurrent
> heap access), why not simply forget it,
We can set flag in ItemData and register callback function in
buffer header regardless concurrent heap/index access. So buffer
will be cleaned before throwing it out from buffer pool
(little optimization: if at the time when pin drops to 0 buffer
is undirty then we shouldn't really clean it up to avoid unnecessary
write - we can save info in FSM that space is available and clean it
up on first pin/read).
So, only ability of *immediate reusing* is not guaranteed. But this is
general problem of space reusing till we assume that buffer pin is
enough to access data.
> since above sounds rather expensive ?
I'm not sure. For non-overwriting smgr required UNDO info is pretty
small because of we're not required to keep tuple data, unlike
Oracle & Co. We can even store UNDO info in non-WAL format to avoid
log record header overhead. UNDO files would be kind of Oracle rollback
segments but muuuuch smaller. But yeh - additional log reads.
> The downside would only be, that long running txn's cannot
> [easily] rollback to savepoint.
We should implement savepoints for all or none transactions, no?
> > 2. Abort long running transactions.
>
> This is imho "the" big downside of UNDO, and should not
> simply be put on the TODO without thorow research. I think it
> would be better to forget UNDO for long running transactions
> before aborting them.
Abort could be configurable.
Vadim
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
From pgsql-hackers-owner+M9243@postgresql.org Wed May 23 04:12:50 2001
Return-path: <pgsql-hackers-owner+M9243@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4N8CoQ08950
for <pgman@candle.pha.pa.us>; Wed, 23 May 2001 04:12:50 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4N885A32881;
Wed, 23 May 2001 04:08:05 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9243@postgresql.org)
Received: from reorxrsm.server.lan.at (zep3.it-austria.net [213.150.1.73])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4N7ZpA12878
for <pgsql-hackers@postgresql.org>; Wed, 23 May 2001 03:35:54 -0400 (EDT)
(envelope-from ZeugswetterA@wien.spardat.at)
Received: from gz0153.gc.spardat.at (gz0153.gc.spardat.at [172.20.10.149])
by reorxrsm.server.lan.at (8.11.2/8.11.2) with ESMTP id f4N7ZZt24346
for <pgsql-hackers@postgresql.org>; Wed, 23 May 2001 09:35:35 +0200
Received: by sdexcgtw01.f000.d0188.sd.spardat.at with Internet Mail Service (5.5.2650.21)
id <K5WGTHD8>; Wed, 23 May 2001 09:35:23 +0200
Message-ID: <11C1E6749A55D411A9670001FA6879633682ED@sdexcsrv1.f000.d0188.sd.spardat.at>
From: Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>
To: "'Mikheev, Vadim'" <vmikheev@SECTORBASE.COM>,
"'Bruce Momjian'"
<pgman@candle.pha.pa.us>
cc: The Hermit Hacker <scrappy@hub.org>, Tom Lane <tgl@sss.pgh.pa.us>,
pgsql-hackers@postgresql.org
Subject: AW: [HACKERS] Plans for solving the VACUUM problem
Date: Wed, 23 May 2001 09:35:22 +0200
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.21)
Content-Type: text/plain;
charset="iso-8859-1"
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
> If community will not like UNDO then I'll probably try to implement
Imho UNDO would be great under the following circumstances:
1. The undo is only registered for some background work process
and not done in the client's backend (or only if it is a small txn).
2. The same mechanism should also be used for outdated tuples
(the only difference beeing, that some tuples need to wait longer
because of an active xid)
The reasoning to not do it in the client's backend is not only that the client
does not need to wait, but that the nervous dba tends to kill them if after one hour
of forward work the backend seemingly does not respond anymore (because it is
busy with undo).
> dead space collector which will read log files and so on.
Which would then only be a possible implementation variant of above :-)
First step probably would be to separate the physical log to reduce WAL size.
> to implement logging for non-btree indices (anyway required for UNDO,
> WAL-based BAR, WAL-based space reusing).
Imho it would be great to implement a generic (albeit more expensive)
redo for all possible index types, that would be used in absence of a physical
redo for that particular index type (which is currently available for btree).
The prerequisites would be a physical log that saves the page before
modification. The redo could then be done (with the info from the heap tuple log record)
with the same index interface, that is used during normal operation.
Imho implementing a new index type is difficult enough as is without the need
to write a redo and undo.
Andreas
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/users-lounge/docs/faq.html
From pgsql-hackers-owner+M9245@postgresql.org Wed May 23 04:41:13 2001
Return-path: <pgsql-hackers-owner+M9245@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4N8fDQ09762
for <pgman@candle.pha.pa.us>; Wed, 23 May 2001 04:41:13 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4N8ZZA45573;
Wed, 23 May 2001 04:35:35 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9245@postgresql.org)
Received: from fizbanrsm.server.lan.at (zep4.it-austria.net [213.150.1.74])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4N8QjA42040
for <pgsql-hackers@postgresql.org>; Wed, 23 May 2001 04:26:45 -0400 (EDT)
(envelope-from ZeugswetterA@wien.spardat.at)
Received: from gz0153.gc.spardat.at (gz0153.gc.spardat.at [172.20.10.149])
by fizbanrsm.server.lan.at (8.11.2/8.11.2) with ESMTP id f4N8Qa826319
for <pgsql-hackers@postgresql.org>; Wed, 23 May 2001 10:26:36 +0200
Received: by sdexcgtw01.f000.d0188.sd.spardat.at with Internet Mail Service (5.5.2650.21)
id <K5WGTHY2>; Wed, 23 May 2001 10:26:28 +0200
Message-ID: <11C1E6749A55D411A9670001FA6879633682EE@sdexcsrv1.f000.d0188.sd.spardat.at>
From: Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>
To: "'Bruce Momjian'" <pgman@candle.pha.pa.us>,
Hiroshi Inoue
<Inoue@tpf.co.jp>
cc: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>,
The Hermit Hacker
<scrappy@hub.org>, Tom Lane <tgl@sss.pgh.pa.us>,
pgsql-hackers@postgresql.org
Subject: AW: [HACKERS] Plans for solving the VACUUM problem
Date: Wed, 23 May 2001 10:26:26 +0200
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.21)
Content-Type: text/plain;
charset="iso-8859-1"
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
> > People also have referred to an overwriting smgr
> > easily. Please tell me how to introduce an overwriting smgr
> > without UNDO.
There is no way. Although undo for an overwriting smgr would involve a
very different approach than with non-overwriting. See Vadim's post about what
info suffices for undo in non overwriting smgr (file and ctid).
> I guess that is the question. Are we heading for an overwriting storage
> manager? I didn't see that in Vadim's list of UNDO advantages, but
> maybe that is his final goal. If so UNDO may make sense, but then the
> question is how do we keep MVCC with an overwriting storage manager?
>
> The only way I can see doing it is to throw the old tuples into the WAL
> and have backends read through that for MVCC info.
If PostgreSQL wants to stay MVCC, then we should imho forget "overwriting smgr"
very fast.
Let me try to list the pros and cons that I can think of:
Pro:
no index modification if key stays same
no search for free space for update (if tuple still fits into page)
no pg_log
Con:
additional IO to write "before image" to rollback segment
(every before image, not only first after checkpoint)
(also before image of every index page that is updated !)
need a rollback segment that imposes all sorts of contention problems
active rollback, that needs to do a lot of undo work
Andreas
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
From ZeugswetterA@wien.spardat.at Wed May 23 05:25:30 2001
Return-path: <ZeugswetterA@wien.spardat.at>
Received: from fizbanrsm.server.lan.at (zep4.it-austria.net [213.150.1.74])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4N9PSQ11379
for <pgman@candle.pha.pa.us>; Wed, 23 May 2001 05:25:29 -0400 (EDT)
Received: from gz0153.gc.spardat.at (gz0153.gc.spardat.at [172.20.10.149])
by fizbanrsm.server.lan.at (8.11.2/8.11.2) with ESMTP id f4N9PJ812775
for <pgman@candle.pha.pa.us>; Wed, 23 May 2001 11:25:19 +0200
Received: by sdexcgtw01.f000.d0188.sd.spardat.at with Internet Mail Service (5.5.2650.21)
id <K5WGT2QN>; Wed, 23 May 2001 11:25:12 +0200
Message-ID: <11C1E6749A55D411A9670001FA6879633682F0@sdexcsrv1.f000.d0188.sd.spardat.at>
From: Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>
To: "'Philip Warner'" <pjw@rhyme.com.au>,
"Mikheev, Vadim"
<vmikheev@SECTORBASE.COM>,
"'Bruce Momjian'" <pgman@candle.pha.pa.us>
cc: The Hermit Hacker <scrappy@hub.org>, Tom Lane <tgl@sss.pgh.pa.us>,
pgsql-hackers@postgresql.org
Subject: AW: [HACKERS] Plans for solving the VACUUM problem
Date: Wed, 23 May 2001 11:25:12 +0200
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.21)
Content-Type: text/plain;
charset="iso-8859-1"
Status: OR
> >If community will not like UNDO then I'll probably try to implement
> >dead space collector which will read log files and so on.
>
> I'd vote for UNDO; in terms of usability & friendliness it's a big win.
Could you please try it a little more verbose ? I am very interested in
the advantages you see in "UNDO for rollback only".
pg_log is a very big argument, but couldn't we try to change the format
to something that only stores ranges of aborted txn's in a btree like format ?
Now that we have WAL, that should be possible.
Andreas
From pjw@rhyme.com.au Wed May 23 06:45:18 2001
Return-path: <pjw@rhyme.com.au>
Received: from acheron.rime.com.au (albatr.lnk.telstra.net [139.130.54.222])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4NAjGQ27811
for <pgman@candle.pha.pa.us>; Wed, 23 May 2001 06:45:16 -0400 (EDT)
Received: from oberon ([203.8.195.100])
by acheron.rime.com.au (8.11.2/8.11.2/SuSE Linux 8.11.1-0.5) with SMTP id f4NAhQK04805;
Wed, 23 May 2001 20:43:42 +1000
Message-ID: <3.0.5.32.20010523204324.02bd14b0@mail.rhyme.com.au>
X-Sender: pjw@mail.rhyme.com.au
X-Mailer: QUALCOMM Windows Eudora Pro Version 3.0.5 (32)
Date: Wed, 23 May 2001 20:43:24 +1000
To: Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>,
"Mikheev, Vadim" <vmikheev@SECTORBASE.COM>,
"'Bruce Momjian'" <pgman@candle.pha.pa.us>
From: Philip Warner <pjw@rhyme.com.au>
Subject: Re: AW: [HACKERS] Plans for solving the VACUUM problem
cc: The Hermit Hacker <scrappy@hub.org>, Tom Lane <tgl@sss.pgh.pa.us>,
pgsql-hackers@postgresql.org
In-Reply-To: <11C1E6749A55D411A9670001FA6879633682F0@sdexcsrv1.f000.d018
8.sd.spardat.at>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Status: ORr
At 11:25 23/05/01 +0200, Zeugswetter Andreas SB wrote:
>
>> >If community will not like UNDO then I'll probably try to implement
>> >dead space collector which will read log files and so on.
>>
>> I'd vote for UNDO; in terms of usability & friendliness it's a big win.
>
>Could you please try it a little more verbose ? I am very interested in
>the advantages you see in "UNDO for rollback only".
I have not been paying strict attention to this thread, so it may have
wandered into a narrower band than I think we are in, but my understanding
is that UNDO is required for partial rollback in the case of failed
commands withing a single TX. Specifically,
- A simple typo in psql can currently cause a forced rollback of the entire
TX. UNDO should avoid this.
- It is not uncommon for application in other databases to handle errors
from the database (eg. missing FKs), and continue a TX.
- Similarly, when we get a new error reporting system, general constraint
(or other) failures should be able to be handled in one TX.
----------------------------------------------------------------
Philip Warner | __---_____
Albatross Consulting Pty. Ltd. |----/ - \
(A.B.N. 75 008 659 498) | /(@) ______---_
Tel: (+61) 0500 83 82 81 | _________ \
Fax: (+61) 0500 83 82 82 | ___________ |
Http://www.rhyme.com.au | / \|
| --________--
PGP key available upon request, | /
and from pgp5.ai.mit.edu:11371 |/
From vmikheev@SECTORBASE.COM Thu May 24 14:07:24 2001
Return-path: <vmikheev@SECTORBASE.COM>
Received: from mailer.sectorbase.com (mailer.sectorbase.com [63.88.121.2])
by candle.pha.pa.us (8.10.1/8.10.1) with SMTP id f4OI7Nt20455
for <pgman@candle.pha.pa.us>; Thu, 24 May 2001 14:07:23 -0400 (EDT)
Received: (qmail 98123 invoked by uid 503); 24 May 2001 18:07:18 -0000
Received: from sectorbase2.sectorbase.com (192.168.254.2)
by gate1.sectorbase.com with SMTP; 24 May 2001 18:07:18 -0000
Received: by sectorbase2.sectorbase.com with Internet Mail Service (5.5.2653.19)
id <LG3CDGNA>; Thu, 24 May 2001 11:06:08 -0700
Message-ID: <3705826352029646A3E91C53F7189E32016653@sectorbase2.sectorbase.com>
From: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>
To: "'Zeugswetter Andreas SB'" <ZeugswetterA@wien.spardat.at>,
"'Philip Warner'" <pjw@rhyme.com.au>,
"'Bruce Momjian'"
<pgman@candle.pha.pa.us>
cc: The Hermit Hacker <scrappy@hub.org>, Tom Lane <tgl@sss.pgh.pa.us>,
pgsql-hackers@postgresql.org
Subject: RE: AW: [HACKERS] Plans for solving the VACUUM problem
Date: Thu, 24 May 2001 11:06:08 -0700
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
Content-Type: text/plain;
charset="iso-8859-1"
Status: OR
> > - A simple typo in psql can currently cause a forced
> > rollback of the entire TX. UNDO should avoid this.
>
> Yes, I forgot to mention this very big advantage, but undo is
> not the only possible way to implement savepoints. Solutions
> using CommandCounter have been discussed.
This would be hell.
Vadim
From ZeugswetterA@wien.spardat.at Fri May 25 03:44:30 2001
Return-path: <ZeugswetterA@wien.spardat.at>
Received: from fizbanrsm.server.lan.at (zep4.it-austria.net [213.150.1.74])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4P7iTt10069
for <pgman@candle.pha.pa.us>; Fri, 25 May 2001 03:44:29 -0400 (EDT)
Received: from gz0153.gc.spardat.at (gz0153.gc.spardat.at [172.20.10.149])
by fizbanrsm.server.lan.at (8.11.2/8.11.2) with ESMTP id f4P7iM332208
for <pgman@candle.pha.pa.us>; Fri, 25 May 2001 09:44:22 +0200
Received: by sdexcgtw01.f000.d0188.sd.spardat.at with Internet Mail Service (5.5.2650.21)
id <K5WGTQC3>; Fri, 25 May 2001 09:44:14 +0200
Message-ID: <11C1E6749A55D411A9670001FA6879633682F3@sdexcsrv1.f000.d0188.sd.spardat.at>
From: Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>
To: "'Mikheev, Vadim'" <vmikheev@SECTORBASE.COM>,
"'Don Baccus'"
<dhogaza@pacifier.com>, Tom Lane <tgl@sss.pgh.pa.us>,
Hiroshi Inoue
<Inoue@tpf.co.jp>
cc: Bruce Momjian <pgman@candle.pha.pa.us>,
The Hermit Hacker
<scrappy@hub.org>, pgsql-hackers@postgresql.org
Subject: AW: [HACKERS] Plans for solving the VACUUM problem
Date: Fri, 25 May 2001 09:44:14 +0200
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.21)
Content-Type: text/plain;
charset="iso-8859-1"
Status: OR
> > >> Impractical ? Oracle does it.
> > >
> > >Oracle has MVCC?
> >
> > With restrictions, yes.
>
> What restrictions? Rollback segments size?
No, that is not the whole story. The problem with their "rollback segment approach" is,
that they do not guard against overwriting a tuple version in the rollback segment.
They simply recycle each segment in a wrap around manner.
Thus there could be an open transaction that still wanted to see a tuple version
that was already overwritten, leading to the feared "snapshot too old" error.
Copying their "rollback segment" approach is imho the last thing we want to do.
> Non-overwriting smgr can eat all disk space...
>
> > You didn't know that? Vadim did ...
>
> Didn't I mention a few times that I was inspired by Oracle? -:)
Looking at what they supply in the feature area is imho good.
Copying their technical architecture is not so good in general.
Andreas
From pgsql-hackers-owner+M9354@postgresql.org Fri May 25 04:10:48 2001
Return-path: <pgsql-hackers-owner+M9354@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4P8Alt10967
for <pgman@candle.pha.pa.us>; Fri, 25 May 2001 04:10:48 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4P89GA75319;
Fri, 25 May 2001 04:09:16 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9354@postgresql.org)
Received: from fizbanrsm.server.lan.at (zep4.it-austria.net [213.150.1.74])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4P7iSA59404
for <pgsql-hackers@postgresql.org>; Fri, 25 May 2001 03:44:33 -0400 (EDT)
(envelope-from ZeugswetterA@wien.spardat.at)
Received: from gz0153.gc.spardat.at (gz0153.gc.spardat.at [172.20.10.149])
by fizbanrsm.server.lan.at (8.11.2/8.11.2) with ESMTP id f4P7iM332218
for <pgsql-hackers@postgresql.org>; Fri, 25 May 2001 09:44:22 +0200
Received: by sdexcgtw01.f000.d0188.sd.spardat.at with Internet Mail Service (5.5.2650.21)
id <K5WGTQC3>; Fri, 25 May 2001 09:44:14 +0200
Message-ID: <11C1E6749A55D411A9670001FA6879633682F3@sdexcsrv1.f000.d0188.sd.spardat.at>
From: Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>
To: "'Mikheev, Vadim'" <vmikheev@SECTORBASE.COM>,
"'Don Baccus'"
<dhogaza@pacifier.com>, Tom Lane <tgl@sss.pgh.pa.us>,
Hiroshi Inoue
<Inoue@tpf.co.jp>
cc: Bruce Momjian <pgman@candle.pha.pa.us>,
The Hermit Hacker
<scrappy@hub.org>, pgsql-hackers@postgresql.org
Subject: AW: [HACKERS] Plans for solving the VACUUM problem
Date: Fri, 25 May 2001 09:44:14 +0200
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.21)
Content-Type: text/plain;
charset="iso-8859-1"
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
> > >> Impractical ? Oracle does it.
> > >
> > >Oracle has MVCC?
> >
> > With restrictions, yes.
>
> What restrictions? Rollback segments size?
No, that is not the whole story. The problem with their "rollback segment approach" is,
that they do not guard against overwriting a tuple version in the rollback segment.
They simply recycle each segment in a wrap around manner.
Thus there could be an open transaction that still wanted to see a tuple version
that was already overwritten, leading to the feared "snapshot too old" error.
Copying their "rollback segment" approach is imho the last thing we want to do.
> Non-overwriting smgr can eat all disk space...
>
> > You didn't know that? Vadim did ...
>
> Didn't I mention a few times that I was inspired by Oracle? -:)
Looking at what they supply in the feature area is imho good.
Copying their technical architecture is not so good in general.
Andreas
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
From pgsql-hackers-owner+M9402@postgresql.org Mon May 28 04:14:09 2001
Return-path: <pgsql-hackers-owner+M9402@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4S8E8a27526
for <pgman@candle.pha.pa.us>; Mon, 28 May 2001 04:14:09 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4S8CtA91878;
Mon, 28 May 2001 04:12:55 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9402@postgresql.org)
Received: from reorxrsm.server.lan.at (zep3.it-austria.net [213.150.1.73])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4S83fA87860
for <pgsql-hackers@postgresql.org>; Mon, 28 May 2001 04:03:41 -0400 (EDT)
(envelope-from ZeugswetterA@wien.spardat.at)
Received: from gz0153.gc.spardat.at (gz0153.gc.spardat.at [172.20.10.149])
by reorxrsm.server.lan.at (8.11.2/8.11.2) with ESMTP id f4S83bj01495
for <pgsql-hackers@postgresql.org>; Mon, 28 May 2001 10:03:37 +0200
Received: by sdexcgtw01.f000.d0188.sd.spardat.at with Internet Mail Service (5.5.2650.21)
id <K5WGTYF3>; Mon, 28 May 2001 10:02:24 +0200
Message-ID: <11C1E6749A55D411A9670001FA6879633682F5@sdexcsrv1.f000.d0188.sd.spardat.at>
From: Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>
To: "'Mikheev, Vadim'" <vmikheev@SECTORBASE.COM>,
"'Hannu Krosing'"
<hannu@tm.ee>
cc: "'Don Baccus'" <dhogaza@pacifier.com>, Tom Lane <tgl@sss.pgh.pa.us>,
Hiroshi Inoue <Inoue@tpf.co.jp>, Bruce Momjian <pgman@candle.pha.pa.us>,
The Hermit Hacker <scrappy@hub.org>, pgsql-hackers@postgresql.org
Subject: AW: [HACKERS] Plans for solving the VACUUM problem
Date: Mon, 28 May 2001 10:02:17 +0200
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.21)
Content-Type: text/plain;
charset="iso-8859-1"
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
> > You mean it is restored in session that is running the transaction ?
Depends on what you mean with restored. It first reads the heap page,
sees that it needs an older version and thus reads it from the "rollback segment".
> >
> > I guess thet it could be slower than our current way of doing it.
>
> Yes, for older transactions which *really* need in *particular*
> old data, but not for newer ones. Look - now transactions have to read
> dead data again and again, even if some of them (newer) need not to see
> those data at all, and we keep dead data as long as required for other
> old transactions *just for the case* they will look there.
> But who knows?! Maybe those old transactions will not read from table
> with big amount of dead data at all! So - why keep dead data in datafiles
> for long time? This obviously affects overall system performance.
Yes, that is a good description. And old version is only required in the following
two cases:
1. the txn that modified this tuple is still open (reader in default committed read)
2. reader is in serializable transaction isolation and has earlier xtid
Seems overwrite smgr has mainly advantages in terms of speed for operations
other than rollback.
Andreas
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
From pgsql-hackers-owner+M9403@postgresql.org Mon May 28 05:16:44 2001
Return-path: <pgsql-hackers-owner+M9403@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4S9Gia00375
for <pgman@candle.pha.pa.us>; Mon, 28 May 2001 05:16:44 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4S9FbA17309;
Mon, 28 May 2001 05:15:37 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9403@postgresql.org)
Received: from taru.tm.ee (taru.tm.ee [194.204.62.23])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4S956A13403
for <pgsql-hackers@postgresql.org>; Mon, 28 May 2001 05:05:07 -0400 (EDT)
(envelope-from hannu@tm.ee)
Received: from tm.ee (localhost.localdomain [127.0.0.1])
by taru.tm.ee (8.11.2/8.11.2) with ESMTP id f4S9BkI10488;
Mon, 28 May 2001 11:11:46 +0200
Message-ID: <3B121652.C4DCE1F6@tm.ee>
Date: Mon, 28 May 2001 11:11:46 +0200
From: Hannu Krosing <hannu@tm.ee>
X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.4.2-2 i686)
X-Accept-Language: et, en, ru
MIME-Version: 1.0
To: Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>
cc: "'Mikheev, Vadim'" <vmikheev@SECTORBASE.COM>,
"'Don Baccus'" <dhogaza@pacifier.com>, Tom Lane <tgl@sss.pgh.pa.us>,
Hiroshi Inoue <Inoue@tpf.co.jp>, Bruce Momjian <pgman@candle.pha.pa.us>,
The Hermit Hacker <scrappy@hub.org>, pgsql-hackers@postgresql.org
Subject: Re: AW: [HACKERS] Plans for solving the VACUUM problem
References: <11C1E6749A55D411A9670001FA6879633682F5@sdexcsrv1.f000.d0188.sd.spardat.at>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
Zeugswetter Andreas SB wrote:
>
> > > You mean it is restored in session that is running the transaction ?
>
> Depends on what you mean with restored. It first reads the heap page,
> sees that it needs an older version and thus reads it from the "rollback segment".
So are whole pages stored in rollback segments or just the modified data
?
Storing whole pages could be very wasteful for tables with small records
that
are often modified.
---------------
Hannu
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
From vmikheev@sectorbase.com Mon May 28 13:15:16 2001
Return-path: <vmikheev@sectorbase.com>
Received: from mailer.sectorbase.com (mailer.sectorbase.com [63.88.121.2])
by candle.pha.pa.us (8.10.1/8.10.1) with SMTP id f4SHFFg01624
for <pgman@candle.pha.pa.us>; Mon, 28 May 2001 13:15:15 -0400 (EDT)
Received: (qmail 22525 invoked by uid 503); 28 May 2001 17:15:10 -0000
Received: from din4.sectorbase.com (HELO dune) (63.88.121.74)
by gate1.sectorbase.com with SMTP; 28 May 2001 17:15:10 -0000
Message-ID: <007c01c0e799$c54dd9c0$4a79583f@sectorbase.com>
From: "Vadim Mikheev" <vmikheev@sectorbase.com>
To: "Hannu Krosing" <hannu@tm.ee>,
"Zeugswetter Andreas SB" <ZeugswetterA@wien.spardat.at>
cc: "'Don Baccus'" <dhogaza@pacifier.com>, "Tom Lane" <tgl@sss.pgh.pa.us>,
"Hiroshi Inoue" <Inoue@tpf.co.jp>, "Bruce Momjian" <pgman@candle.pha.pa.us>,
"The Hermit Hacker" <scrappy@hub.org>, <pgsql-hackers@postgresql.org>
References: <11C1E6749A55D411A9670001FA6879633682F5@sdexcsrv1.f000.d0188.sd.spardat.at> <3B121652.C4DCE1F6@tm.ee>
Subject: Re: AW: [HACKERS] Plans for solving the VACUUM problem
Date: Mon, 28 May 2001 10:15:17 -0700
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
Status: OR
> > > > You mean it is restored in session that is running the transaction ?
> >
> > Depends on what you mean with restored. It first reads the heap page,
> > sees that it needs an older version and thus reads it from the "rollback segment".
>
> So are whole pages stored in rollback segments or just the modified data?
This is implementation dependent. Storing whole pages is much easy to do,
but obviously it's better to store just modified data.
Vadim
From pgsql-hackers-owner+M9458@postgresql.org Tue May 29 13:49:27 2001
Return-path: <pgsql-hackers-owner+M9458@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4THnQ712093
for <pgman@candle.pha.pa.us>; Tue, 29 May 2001 13:49:26 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4THmoE17911;
Tue, 29 May 2001 13:48:50 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9458@postgresql.org)
Received: from mailer.sectorbase.com (mailer.sectorbase.com [63.88.121.2])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4THfTE14406
for <pgsql-hackers@postgresql.org>; Tue, 29 May 2001 13:41:29 -0400 (EDT)
(envelope-from vmikheev@SECTORBASE.COM)
Received: (qmail 33510 invoked by uid 503); 29 May 2001 17:41:25 -0000
Received: from sectorbase2.sectorbase.com (192.168.254.2)
by gate1.sectorbase.com with SMTP; 29 May 2001 17:41:25 -0000
Received: by sectorbase2.sectorbase.com with Internet Mail Service (5.5.2653.19)
id <LG3CDR6T>; Tue, 29 May 2001 10:39:59 -0700
Message-ID: <3705826352029646A3E91C53F7189E3201665C@sectorbase2.sectorbase.com>
From: "Mikheev, Vadim" <vmikheev@SECTORBASE.COM>
To: "'Zeugswetter Andreas SB'" <ZeugswetterA@wien.spardat.at>
cc: "'pgsql-hackers@postgresql.org'" <pgsql-hackers@postgresql.org>
Subject: RE: AW: [HACKERS] Plans for solving the VACUUM problem
Date: Tue, 29 May 2001 10:39:59 -0700
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
Content-Type: text/plain;
charset="iso-8859-1"
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
> > > So are whole pages stored in rollback segments or just
> > > the modified data?
> >
> > This is implementation dependent. Storing whole pages is
> > much easy to do, but obviously it's better to store just
> > modified data.
>
> I am not sure it is necessarily better. Seems to be a tradeoff here.
> pros of whole pages:
> a possible merge with physical log (for first
> modification of a page after checkpoint
> there would be no overhead compared to current
> since it is already written now)
Using WAL as RS data storage is questionable.
> in a clever implementation a page already in the
> "rollback segment" might satisfy the
> modification of another row on that page, and
> thus would not need any additional io.
This would be possible only if there was no commit (same SCN)
between two modifications.
But, aren't we too deep on overwriting smgr (O-smgr) implementation?
It's doable. It has advantages in terms of IO active transactions
must do to follow MVCC. It has drawback in terms of required
disk space (and, oh yeh, it's not easy to implement -:)).
So, any other opinions about value of O-smgr?
Vadim
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
From pgsql-hackers-owner+M9173@postgresql.org Tue May 22 04:27:18 2001
Return-path: <pgsql-hackers-owner+M9173@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4M8RHQ08426
for <pgman@candle.pha.pa.us>; Tue, 22 May 2001 04:27:18 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4M8P5A26187;
Tue, 22 May 2001 04:25:05 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9173@postgresql.org)
Received: from reorxrsm.server.lan.at (zep3.it-austria.net [213.150.1.73])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4M7seA10340
for <pgsql-hackers@postgresql.org>; Tue, 22 May 2001 03:54:40 -0400 (EDT)
(envelope-from ZeugswetterA@wien.spardat.at)
Received: from gz0153.gc.spardat.at (gz0153.gc.spardat.at [172.20.10.149])
by reorxrsm.server.lan.at (8.11.2/8.11.2) with ESMTP id f4M7saP09352
for <pgsql-hackers@postgresql.org>; Tue, 22 May 2001 09:54:36 +0200
Received: by sdexcgtw01.f000.d0188.sd.spardat.at with Internet Mail Service (5.5.2650.21)
id <K5WGS0MG>; Tue, 22 May 2001 09:54:30 +0200
Message-ID: <11C1E6749A55D411A9670001FA6879633682E6@sdexcsrv1.f000.d0188.sd.spardat.at>
From: Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>
To: "'Barry Lind'" <barry@xythos.com>, pgsql-hackers@postgresql.org
Subject: AW: AW: [HACKERS] Plans for solving the VACUUM problem
Date: Tue, 22 May 2001 09:54:21 +0200
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.21)
Content-Type: text/plain;
charset="iso-8859-1"
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
> Correct me if I am wrong, but both cases do present a problem currently
> in 7.1. The WAL log will not remove any WAL files for transactions that
> are still open (even after a checkpoint occurs). Thus if you do a bulk
> insert of gigabyte size you will require a gigabyte sized WAL
> directory. Also if you have a simple OLTP transaction that the user
> started and walked away from for his one week vacation, then no WAL log
> files can be deleted until that user returns from his vacation and ends
> his transaction.
I am not sure, it might be so implemented. But there is no technical reason
to keep them beyond checkpoint without UNDO.
Andreas
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly
From pgsql-hackers-owner+M9170@postgresql.org Tue May 22 04:20:39 2001
Return-path: <pgsql-hackers-owner+M9170@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4M8KcQ08175
for <pgman@candle.pha.pa.us>; Tue, 22 May 2001 04:20:38 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4M8EnA20785;
Tue, 22 May 2001 04:14:49 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9170@postgresql.org)
Received: from reorxrsm.server.lan.at (zep3.it-austria.net [213.150.1.73])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4M87AA17155
for <pgsql-hackers@postgresql.org>; Tue, 22 May 2001 04:07:10 -0400 (EDT)
(envelope-from ZeugswetterA@wien.spardat.at)
Received: from gz0153.gc.spardat.at (gz0153.gc.spardat.at [172.20.10.149])
by reorxrsm.server.lan.at (8.11.2/8.11.2) with ESMTP id f4M876P14958
for <pgsql-hackers@postgresql.org>; Tue, 22 May 2001 10:07:06 +0200
Received: by sdexcgtw01.f000.d0188.sd.spardat.at with Internet Mail Service (5.5.2650.21)
id <K5WGS0S9>; Tue, 22 May 2001 10:06:57 +0200
Message-ID: <11C1E6749A55D411A9670001FA6879633682E7@sdexcsrv1.f000.d0188.sd.spardat.at>
From: Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>
To: "'Jan Wieck'" <JanWieck@yahoo.com>, Barry Lind <barry@xythos.com>
cc: pgsql-hackers@postgresql.org
Subject: AW: AW: [HACKERS] Plans for solving the VACUUM problem
Date: Tue, 22 May 2001 10:06:54 +0200
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.21)
Content-Type: text/plain;
charset="iso-8859-1"
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
> As a rule of thumb, online applications that hold open
> transactions during user interaction are considered to be
> Broken By Design (tm). So I'd slap the programmer/design
> team with - let's use the server box since it doesn't contain
> anything useful.
We have a database system here, and not an OLTP helper app.
A database system must support all sorts of mixed usage from simple
OLTP to OLAP. Imho the usual separation on different servers gives more
headaches than are necessary.
Thus above statement can imho be true for one OLTP application, but not
for all applications on one db server.
Andreas
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly
From pgsql-hackers-owner+M9175@postgresql.org Tue May 22 05:41:09 2001
Return-path: <pgsql-hackers-owner+M9175@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4M9f5Q12618
for <pgman@candle.pha.pa.us>; Tue, 22 May 2001 05:41:05 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4M9d8A57688;
Tue, 22 May 2001 05:39:08 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9175@postgresql.org)
Received: from reorxrsm.server.lan.at (zep3.it-austria.net [213.150.1.73])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4M9RZA52748
for <pgsql-hackers@postgresql.org>; Tue, 22 May 2001 05:27:35 -0400 (EDT)
(envelope-from ZeugswetterA@wien.spardat.at)
Received: from gz0153.gc.spardat.at (gz0153.gc.spardat.at [172.20.10.149])
by reorxrsm.server.lan.at (8.11.2/8.11.2) with ESMTP id f4M9RUP15035
for <pgsql-hackers@postgresql.org>; Tue, 22 May 2001 11:27:30 +0200
Received: by sdexcgtw01.f000.d0188.sd.spardat.at with Internet Mail Service (5.5.2650.21)
id <K5WGTASQ>; Tue, 22 May 2001 11:27:22 +0200
Message-ID: <11C1E6749A55D411A9670001FA6879633682E9@sdexcsrv1.f000.d0188.sd.spardat.at>
From: Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>
To: "'Mikheev, Vadim'" <vmikheev@SECTORBASE.COM>,
"'Tom Lane'"
<tgl@sss.pgh.pa.us>
cc: pgsql-hackers@postgresql.org
Subject: AW: AW: [HACKERS] Plans for solving the VACUUM problem
Date: Tue, 22 May 2001 11:27:19 +0200
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.21)
Content-Type: text/plain;
charset="iso-8859-1"
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
> Todo:
>
> 1. Compact log files after checkpoint (save records of uncommitted
> transactions and remove/archive others).
On the grounds that undo is not guaranteed anyway (concurrent heap access),
why not simply forget it, since above sounds rather expensive ?
The downside would only be, that long running txn's cannot [easily] rollback
to savepoint.
> 2. Abort long running transactions.
This is imho "the" big downside of UNDO, and should not simply be put on
the TODO without thorow research. I think it would be better to forget UNDO for long
running transactions before aborting them.
Andreas
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
From pgsql-hackers-owner+M9246@postgresql.org Wed May 23 04:58:55 2001
Return-path: <pgsql-hackers-owner+M9246@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4N8wsQ10317
for <pgman@candle.pha.pa.us>; Wed, 23 May 2001 04:58:54 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4N8s6A52669;
Wed, 23 May 2001 04:54:06 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9246@postgresql.org)
Received: from fizbanrsm.server.lan.at (zep4.it-austria.net [213.150.1.74])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4N8jbA49604
for <pgsql-hackers@postgresql.org>; Wed, 23 May 2001 04:45:37 -0400 (EDT)
(envelope-from ZeugswetterA@wien.spardat.at)
Received: from gz0153.gc.spardat.at (gz0153.gc.spardat.at [172.20.10.149])
by fizbanrsm.server.lan.at (8.11.2/8.11.2) with ESMTP id f4N8jO832710
for <pgsql-hackers@postgresql.org>; Wed, 23 May 2001 10:45:24 +0200
Received: by sdexcgtw01.f000.d0188.sd.spardat.at with Internet Mail Service (5.5.2650.21)
id <K5WGT2AG>; Wed, 23 May 2001 10:45:17 +0200
Message-ID: <11C1E6749A55D411A9670001FA6879633682EF@sdexcsrv1.f000.d0188.sd.spardat.at>
From: Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>
To: "'Mikheev, Vadim'" <vmikheev@SECTORBASE.COM>,
"'Tom Lane'"
<tgl@sss.pgh.pa.us>
cc: pgsql-hackers@postgresql.org
Subject: AW: AW: [HACKERS] Plans for solving the VACUUM problem
Date: Wed, 23 May 2001 10:45:17 +0200
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.21)
Content-Type: text/plain;
charset="iso-8859-1"
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
> > The downside would only be, that long running txn's cannot
> > [easily] rollback to savepoint.
>
> We should implement savepoints for all or none transactions, no?
We should not limit transaction size to online available disk space for WAL.
Imho that is much more important. With guaranteed undo we would need
diskspace for more than 2x new data size (+ at least space for 1x all modified
pages unless physical log is separated from WAL).
Imho a good design should involve only little more than 1x new data size.
>
> > > 2. Abort long running transactions.
> >
> > This is imho "the" big downside of UNDO, and should not
> > simply be put on the TODO without thorow research. I think it
> > would be better to forget UNDO for long running transactions
> > before aborting them.
>
> Abort could be configurable.
The point is, that you need to abort before WAL runs out of disk space
regardless of configuration.
Andreas
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
From pgsql-hackers-owner+M9252@postgresql.org Wed May 23 07:17:03 2001
Return-path: <pgsql-hackers-owner+M9252@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4NBH2Q10577
for <pgman@candle.pha.pa.us>; Wed, 23 May 2001 07:17:02 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4NBGIA12333;
Wed, 23 May 2001 07:16:18 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9252@postgresql.org)
Received: from fizbanrsm.server.lan.at (zep4.it-austria.net [213.150.1.74])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4NB8mA09095
for <pgsql-hackers@postgresql.org>; Wed, 23 May 2001 07:08:48 -0400 (EDT)
(envelope-from ZeugswetterA@wien.spardat.at)
Received: from gz0153.gc.spardat.at (gz0153.gc.spardat.at [172.20.10.149])
by fizbanrsm.server.lan.at (8.11.2/8.11.2) with ESMTP id f4NB8d806512
for <pgsql-hackers@postgresql.org>; Wed, 23 May 2001 13:08:39 +0200
Received: by sdexcgtw01.f000.d0188.sd.spardat.at with Internet Mail Service (5.5.2650.21)
id <K5WGTJP5>; Wed, 23 May 2001 13:08:29 +0200
Message-ID: <11C1E6749A55D411A9670001FA6879633682F2@sdexcsrv1.f000.d0188.sd.spardat.at>
From: Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>
To: "'Philip Warner'" <pjw@rhyme.com.au>,
"Mikheev, Vadim"
<vmikheev@SECTORBASE.COM>,
"'Bruce Momjian'" <pgman@candle.pha.pa.us>
cc: The Hermit Hacker <scrappy@hub.org>, Tom Lane <tgl@sss.pgh.pa.us>,
pgsql-hackers@postgresql.org
Subject: AW: AW: [HACKERS] Plans for solving the VACUUM problem
Date: Wed, 23 May 2001 13:08:28 +0200
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.21)
Content-Type: text/plain;
charset="iso-8859-1"
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
> - A simple typo in psql can currently cause a forced rollback of the entire
> TX. UNDO should avoid this.
Yes, I forgot to mention this very big advantage, but undo is not the only possible way
to implement savepoints. Solutions using CommandCounter have been discussed.
Although the pg_log mechanism would become more complex, a background
"vacuum-like" process could put highest priority on removing such rolled back parts
of transactions.
Andreas
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
From pgsql-hackers-owner+M9443@postgresql.org Tue May 29 04:21:45 2001
Return-path: <pgsql-hackers-owner+M9443@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4T8Li727196
for <pgman@candle.pha.pa.us>; Tue, 29 May 2001 04:21:44 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4T8KTE67371;
Tue, 29 May 2001 04:20:30 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9443@postgresql.org)
Received: from reorxrsm.server.lan.at (zep3.it-austria.net [213.150.1.73])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4T7ZKE41255
for <pgsql-hackers@postgresql.org>; Tue, 29 May 2001 03:35:23 -0400 (EDT)
(envelope-from ZeugswetterA@wien.spardat.at)
Received: from gz0153.gc.spardat.at (gz0153.gc.spardat.at [172.20.10.149])
by reorxrsm.server.lan.at (8.11.2/8.11.2) with ESMTP id f4T7ZG921237
for <pgsql-hackers@postgresql.org>; Tue, 29 May 2001 09:35:16 +0200
Received: by sdexcgtw01.f000.d0188.sd.spardat.at with Internet Mail Service (5.5.2650.21)
id <K5WGT047>; Tue, 29 May 2001 09:35:06 +0200
Message-ID: <11C1E6749A55D411A9670001FA6879633682F8@sdexcsrv1.f000.d0188.sd.spardat.at>
From: Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>
To: "'Vadim Mikheev'" <vmikheev@sectorbase.com>
cc: "'pgsql-hackers@postgresql.org'" <pgsql-hackers@postgresql.org>
Subject: AW: AW: [HACKERS] Plans for solving the VACUUM problem
Date: Tue, 29 May 2001 09:35:01 +0200
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.21)
Content-Type: text/plain;
charset="iso-8859-1"
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
> > > > > You mean it is restored in session that is running the transaction ?
> > >
> > > Depends on what you mean with restored. It first reads the heap page,
> > > sees that it needs an older version and thus reads it from the "rollback segment".
> >
> > So are whole pages stored in rollback segments or just the modified data?
>
> This is implementation dependent. Storing whole pages is much easy to do,
> but obviously it's better to store just modified data.
I am not sure it is necessarily better. Seems to be a tradeoff here.
pros of whole pages:
a possible merge with physical log (for first modification of a page after checkpoint
there would be no overhead compared to current since it is already written now)
in a clever implementation a page already in the "rollback segment" might satisfy the
modification of another row on that page, and thus would not need any additional io.
Andreas
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?
http://www.postgresql.org/search.mpl
From pgsql-hackers-owner+M9473@postgresql.org Wed May 30 06:30:34 2001
Return-path: <pgsql-hackers-owner+M9473@postgresql.org>
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4UAUX715594
for <pgman@candle.pha.pa.us>; Wed, 30 May 2001 06:30:33 -0400 (EDT)
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
by postgresql.org (8.11.3/8.11.1) with SMTP id f4UATiE98735;
Wed, 30 May 2001 06:29:44 -0400 (EDT)
(envelope-from pgsql-hackers-owner+M9473@postgresql.org)
Received: from reorxrsm.server.lan.at (zep3.it-austria.net [213.150.1.73])
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4UAIRE94342
for <pgsql-hackers@postgresql.org>; Wed, 30 May 2001 06:18:28 -0400 (EDT)
(envelope-from ZeugswetterA@wien.spardat.at)
Received: from gz0153.gc.spardat.at (gz0153.gc.spardat.at [172.20.10.149])
by reorxrsm.server.lan.at (8.11.2/8.11.2) with ESMTP id f4UAIKQ15061
for <pgsql-hackers@postgresql.org>; Wed, 30 May 2001 12:18:20 +0200
Received: by sdexcgtw01.f000.d0188.sd.spardat.at with Internet Mail Service (5.5.2650.21)
id <L6WJQW79>; Wed, 30 May 2001 12:18:12 +0200
Message-ID: <11C1E6749A55D411A9670001FA6879633682FE@sdexcsrv1.f000.d0188.sd.spardat.at>
From: Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>
To: "'Mikheev, Vadim'" <vmikheev@SECTORBASE.COM>
cc: "'pgsql-hackers@postgresql.org'" <pgsql-hackers@postgresql.org>
Subject: AW: AW: [HACKERS] Plans for solving the VACUUM problem
Date: Wed, 30 May 2001 12:18:07 +0200
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.21)
Content-Type: text/plain;
charset="iso-8859-1"
Precedence: bulk
Sender: pgsql-hackers-owner@postgresql.org
Status: OR
> > > > So are whole pages stored in rollback segments or just
> > > > the modified data?
> > >
> > > This is implementation dependent. Storing whole pages is
> > > much easy to do, but obviously it's better to store just
> > > modified data.
> >
> > I am not sure it is necessarily better. Seems to be a tradeoff here.
> > pros of whole pages:
> > a possible merge with physical log (for first
> > modification of a page after checkpoint
> > there would be no overhead compared to current
> > since it is already written now)
>
> Using WAL as RS data storage is questionable.
No, I meant the other way around. Move the physical log pages away from WAL
files to the "rollback segment" (imho "snapshot area" would be a better name)
> > in a clever implementation a page already in the
> > "rollback segment" might satisfy the
> > modification of another row on that page, and
> > thus would not need any additional io.
>
> This would be possible only if there was no commit (same SCN)
> between two modifications.
I don't think someone else's commit matters unless it touches the same page.
In that case a reader would possibly need to chain back to an older version
inside the snapshot area, and then it gets complicated even in the whole page
case. A good concept could probably involve both whole page and change
only, and let the optimizer decide what to do.
> But, aren't we too deep on overwriting smgr (O-smgr) implementation?
Yes, but some understanding of the possibilities needs to be sorted out
to allow good decicsions, no ?
Andreas
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly
|