Q1
True / FalseIn PostgreSQL, cardinality refers to the number of rows in a table.
Cardinality is a term used to describe the number of rows in a table.
Q2
True / FalseIn PostgreSQL, high cardinality means that a column has many unique values.
High cardinality refers to a column containing a large number of unique values, such as a primary key or a unique identifier.
Q3
True / FalseIn PostgreSQL, low cardinality means that a column has few unique values.
Low cardinality refers to a column with a small number of unique values, such as a boolean or a column with repeated categorical data.
Q4
True / FalseIn PostgreSQL, indexes on high cardinality columns are generally more effective than on low cardinality columns.
Indexes are typically more effective on high cardinality columns because the uniqueness of the values makes it easier to quickly locate rows.
Q5
True / FalsePostgreSQL uses cardinality information in the query planner to optimize query execution.
The PostgreSQL query planner uses statistics, including cardinality, to choose the most efficient way to execute a query.
Q6
True / FalsePostgreSQL’s ANALYZE command updates the statistics about the cardinality of columns in a table.
The ANALYZE command collects statistics about the distribution of values in each column, which includes cardinality, and updates the query planner.
Q7
True / FalseIn PostgreSQL, high cardinality columns should always be indexed to improve query performance.
While high cardinality columns often benefit from indexing, there are cases where indexing may not be beneficial or necessary depending on the query patterns and workload.
Q8
True / FalseIn PostgreSQL, composite indexes can be useful for queries involving multiple high cardinality columns.
Composite indexes can improve performance for queries that filter or join on multiple high cardinality columns by reducing the search space.
Q9
True / FalsePostgreSQL automatically adjusts query execution plans based on changes in cardinality without requiring manual intervention.
PostgreSQL’s query planner dynamically adjusts execution plans based on updated statistics, including cardinality, to optimize performance.
Q10
True / FalsePostgreSQL allows the use of expression indexes to handle cases where cardinality needs to be optimized for complex queries.
PostgreSQL supports expression indexes, which allow indexing on expressions or functions of columns, providing flexibility in optimizing queries based on cardinality and other factors.