count_distinct

Website

https://github.com/tvondra/count_distinct/

Description

count_distinct provides an alternative to COUNT(DISTINCT ...) which for large amounts of data often ends in sorting and poor performance.

Package naming convention

The PostgreSQL RPM repository uses PostgreSQL version numbers in the RPM packages. For example count_distinct for PostgreSQL 17 is named as count_distinct_17. Similarly count_distinct for PostgreSQL 15 is named as count_distinct_15.

Subpackages

count_distinct provides the following subpackages:

  • llvmjit: Provides just-in-time compilation support for count_distinct

Package specifications and repository requirements

PostgreSQL PGDG RPM repository

Install PGDG repository from: https://yum.postgresql.org/repopackages/

Installation

OS Command
RHEL / Rocky Linux / AlmaLinux / Fedora dnf install count_distinct_17 (or change the version as described above)

Post-installation

Connect to the database that you want to create the extension as superuser and run:
CREATE EXTENSION count_distinct;

Available packages

PostgreSQL version(s) OS version Arch Status
17,16,15,14,13 RHEL / Rocky Linux / AlmaLinux 9 x86_64, aarch64 Available
17,16,15,14,13 RHEL / Rocky Linux / AlmaLinux 8 x86_64, aarch64 Available
17,16,15,14,13 Fedora Linux x86_64 Available