any downside to CREATE STATISTICS for non-unique, multi-column indexes?

If I had the following table/index definition:

create table sku
( id     serial primary key
, color  varchar(10)
, size   varchar(10)

create index sku_color_size on sku(color, size);

I’m wondering if there’s any downside to running

create statistics sku_color_size_stats on sku(color, size);

So that the optimizer has better knowledge of any correlation between color and size. (Let’s say for the moment that I can’t tell in advance that the two might be correlated, but as things work out, I end up having a lot more “blue/small” and “red/large” than other combinations.)

The only downside that I can think of is that my vacuum (whether automatic or manual) might take longer.

Go to Source
Author: Chris Curvey