This is all good optimization advice, but I don&#x27;t think it is applicable to my specific case.<p>My problem is not that PostgreSQL does not understand the distribution of my data.  It does.  The problem is that it comes up with a query plan without realizing that I&#x27;m only querying for a very small range of timestamps.<p>If this happens again, I&#x27;ll have to try rewriting code to send it queries with hard-coded timestamps, cross fingers and pray.  I find prayer quite essential with PostgreSQL sometimes because as ineffective as it is, at times I&#x27;ve got nothing else.