Performance * virtual pivot table vs aggregate view * select * from pivot_table where attribute_001 < X; X rows aggregate virtual (first) virtual (second) --- ---- ----------- -------------- ---------------- 0 0 0.5 0.5 0.1 seconds 1 0 0.5 0.5 0.1 2 2 0.4 0.5 0.1 3 4 0.4 0.5 0.1 10 26 0.4 0.6 0.3 20 44 0.4 0.7 0.3 30 67 0.4 0.8 0.4 40 91 0.4 0.9 0.6 50 116 0.4 1.0 0.7 100 250 0.5 1.6 1.3 200 493 0.5 2.8 2.4 500 1199 0.5 5.8 5.5 * virtual pivot table recalculates the distinct columns at the first query in a database session. * The virtual table is faster for _smaller_ results sets and slower for larger ones. * Similar results for larger tables (100,000 rows instead of 5,000 -- times increased by a factor of 20).