Slide 66
Slide 66 text
Postgres has some good “system tables” that you can look at. I copied this query (and the one from earlier) from their documentation.
We’re querying on DOB and gender, so let’s look at those:
• First, look at the n_distinct column:
• The “-1” means that every value is unique
• If it were a positive integer, it’s the number of unique values
• And the -0.22 is a proportion: It means that for gender, there’s one unique value for every 5 records. Our test data had 3 males and 5 females, so
that seems close.
• It also knows some of the most common values for each column.
Given this, your database can make a guess at the rows we will get back.