I&#x27;m going to ignore your baseless (and incorrect) assertion about &quot;an inferior version&quot; of UPSERT (MySQL&#x27;s doesn&#x27;t work properly except for the primary key).  Your problem is that you are not doing an index only scan.  The reason you are not doing an index only scan is, most likely, that the visibility bit is not set on the table.  This is usually as a result of excessive writing to the table, but sometimes it is due to incorrectly tuned planner settings.  Try setting your cpu_tuple_cost higher and&#x2F;or cpu_index_tuple_cost lower.  I have had to do this in the past to get index only scans to work.  BTW, a quick way to force the issue is to SET enable_seq_scan TO off in psql.<p>I would add, you should really upgrade to 9.4, as there were some performance improvements to aggregates.