Jeff Frost <jeff(at)frostconsultingllc(dot)com> writes:
> So, my question is, should changing the stats target on the shape column
> affect the stats for the content_id and content_type columns?
It would change the size of the sample for the table, which might
improve the accuracy of the stats. IIRC you'd still get the same number
of histogram entries and most-common-values for the other columns, but
they might be more accurate.
> Also, why does the index on content_id win out over the compound index
> on (content_type, content_id)?
It's deciding (apparently correctly, from the explain results) that the
larger index isn't increasing the selectivity enough to be worth its
extra search cost. I suppose content_type = 'Story' isn't very
selective in this table?
regards, tom lane