1. UNLOGGED tables | Operating System: Suse-Linux 10.2 x86_64 | |||||||||
2. 10GB shared buffers | Hardware : 4 core (Intel(R) Xeon(R) CPU L5408 @ 2.13GHz) | |||||||||
3. Number of tuples - 2,000,000 | RAM : 24GB | |||||||||
4. Single connection | ||||||||||
5. All columns INT data type | ||||||||||
STEP-1: INSERT WITH TAILING COLUMNS WITH NULL | ||||||||||
800 cols - 600 nulls | 800 cols - 300 nulls | 300 cols - 150 nulls | 300 cols - 250 nulls | |||||||
Execution time(ms) | space (pages) | Execution time(ms) | space (pages) | Execution time(ms) | space (pages) | Execution time(ms) | space (pages) | |||
Original Code | 9659.534 | 250000 | 70964.223 | 666667 | 7139.723 | 166667 | 3633.513 | 66667 | ||
9660.523 | 250000 | 71137.35 | 666667 | 7181.817 | 166667 | 3690.42 | 66667 | |||
9624.601 | 250000 | 71493.857 | 666667 | 7164.65 | 166667 | 3663.35 | 66667 | |||
9708.767 | 250000 | 71358.109 | 666667 | 7027.79 | 166667 | 3680.935 | 66667 | |||
9709.173 | 250000 | 71560.704 | 666667 | 7008.517 | 166667 | 3690.72 | 66667 | |||
9672.5196 | 250000 | 71302.8486 | 666667 | 7104.4994 | 166667 | 3671.7876 | 66667 | |||
Trim Tailing NULLs pathch | 8728.914 | 222223 | 69659.69 | 666667 | 6942.56 | 166667 | 3388.882 | 58824 | ||
8706.79 | 222223 | 69646.359 | 666667 | 6908.025 | 166667 | 3336.522 | 58824 | |||
8589.396 | 222223 | 69853.287 | 666667 | 6841.875 | 166667 | 3359.254 | 58824 | |||
8729.362 | 222223 | 69277.953 | 666667 | 6891.575 | 166667 | 3267.011 | 58824 | |||
8685.041 | 222223 | 69728.952 | 666667 | 6914.374 | 166667 | 3325.61 | 58824 | |||
8687.9006 | 222223 | 69633.2482 | 666667 | 6899.6818 | 166667 | 3335.4558 | 58824 | |||
10.18% | 11.11% | 2.34% | 0.00% | 2.88% | 0.00% | 9.16% | 11.76% | |||
STEP-2: AFTER STEP-1; UPDATE LAST COLUMN WITH NON-NULL Example: UPDATE TBL SET F800 = 5; (for 800 columns table) |
||||||||||
800 cols - 600 nulls | 800 cols - 300 nulls | 300 cols - 150 nulls | 300 cols - 250 nulls | |||||||
Original Code | Execution time(ms) | space (pages) | Execution time(ms) | space (pages) | Execution time(ms) | space (pages) | Execution time(ms) | space (pages) | ||
44966.365 | 500000 | 142652.134 | 1333334 | 23038.094 | 333334 | 15962.495 | 135633 | |||
44143.511 | 500000 | 141065.271 | 1333334 | 23836.695 | 333334 | 15989.269 | 135633 | |||
44766.451 | 500000 | 133314.792 | 1333334 | 23654.263 | 333334 | 16025.056 | 135633 | |||
44625.44233 | 500000 | 139010.7323 | 1333334 | 23509.684 | 333334 | 15992.27333 | 135633 | |||
Trim Tailing NULLs pathch | 41883.931 | 472223 | 130009.289 | 1333334 | 23914.548 | 333334 | 16085.394 | 127790 | ||
41287.726 | 472223 | 131517.017 | 1333334 | 23014.507 | 333334 | 16222.045 | 127790 | |||
41483.067 | 472223 | 133212.223 | 1333334 | 22042.874 | 333334 | 16396.235 | 127790 | |||
41551.57467 | 472223 | 131579.5097 | 1333334 | 22990.643 | 333334 | 16234.558 | 127790 | |||
6.89% | 5.56% | 5.35% | 0.00% | 2.21% | 0.00% | -1.52% | 5.78% | |||
STEP-3: AFTER STEP-2; UPDATE OPERATION LAST COLUMN WITH
NULL Example: UPDATE TBL SET F800 = NULL; (for 800 columns table) |
||||||||||
800 cols - 600 nulls | 800 cols - 300 nulls | 300 cols - 150 nulls | 300 cols - 250 nulls | |||||||
Original Code | Execution time(ms) | space (pages) | Execution time(ms) | space (pages) | Execution time(ms) | space (pages) | Execution time(ms) | space (pages) | ||
46606.223 | 750000 | 141029.26 | 2000000 | 23655.586 | 500000 | 16300.106 | 202299 | |||
46741.412 | 750000 | 142013.506 | 2000000 | 23983.859 | 500000 | 16466.762 | 202299 | |||
45350.242 | 750000 | 131936.86 | 2000000 | 23305.943 | 500000 | 16294.847 | 202299 | |||
46232.62567 | 750000 | 138326.542 | 2000000 | 23648.46267 | 500000 | 16353.905 | 202299 | |||
Trim Tailing NULLs pathch | 40618.736 | 694445 | 131992.67 | 2000000 | 23853.028 | 500000 | 14758.747 | 186613 | ||
41612.561 | 694445 | 134703.781 | 2000000 | 23730.218 | 500000 | 14720.166 | 186613 | |||
39523.141 | 694445 | 136116.766 | 2000000 | 22823.762 | 500000 | 14605.663 | 186613 | |||
40584.81267 | 694445 | 134271.0723 | 2000000 | 23469.00267 | 500000 | 14694.85867 | 186613 | |||
12.22% | 7.41% | 2.93% | 0.00% | 0.76% | 0.00% | 10.14% | 7.75% | |||