A Faster Way to Do COUNT ( DISTINCT )

04 Feb 2020
15:00-15:45

A Faster Way to Do COUNT ( DISTINCT )

Oracle 19c introduced an unusual set of new SQL functions:

Aggregation functions to create a bitmap:
BITMAP_CONSTRUCT_AGG,ֲ BITMAP_OR_AGG

Relational operators:
BITMAP_COUNT,ֲ BITMAP_BIT_POSITION,ֲ BITMAP_BUCKET_NUMBER

What they do and how to use them may not be obvious at first, so this talk will explain each of them in turn and their utility, and then show you a way to use them to get better performance from COUNT( DISTINCT ) operations – an operation that can be a performance drag when running queries