ODC Appreciation Day: Using PIVOT for Unknown Dimensions

This post goes to #ThanksODC (formerly known as #ThanksOTN) which is initiated by Tim Hall (aka OracleBase).
But first, story time of this. I prepared this bunch of code (continue reading below please), because of being stubborn of being performance enthusiast. While I was working as a consultant, I was first invited to increase performance of an ETL which is already running on production and was running at least 12 hours per run (monthly). We did our best with the features of the ETL tool, paralleled queries, and managed to reduce it to 8-9 hours. But, “it-was-not-enough”!
Continue reading