I've already read this excellent answer for emulating skip scan index to retrieve the distinct values for a single column. This is blazingly fast.
Now what I'm trying to do is to retrieve unique permutations (combinations) across n columns. Each column to be included has an index. There is also a combined unique index across all these columns. The table has upwards of 100'000'000 rows and all my efforts thus far have been painfully slow. Is there any way to apply the skip-scan-index approach to this problem? Any suggestions would be greatly appreciated