presto-orc/src/main/java/io/prestosql/orc/DictionaryCompressionOptimizer.java/DictionaryCompressionOptimizer/estimateIndexBytesPerValue
class DictionaryCompressionOptimizer:    public static int estimateIndexBytesPerValue(int dictionaryEntries)
    {
        // assume basic byte packing
        if (dictionaryEntries <= 256) {
            return 1;
        }
        if (dictionaryEntries <= 65_536) {
            return 2;
        }
        if (dictionaryEntries <= 16_777_216) {
            return 3;
        }
        return 4;
    }