Richard Huxton provided the answer: <i>It's a prepared query-plan, which means it can't plan to use the index because
thenext EXECUTE might have reconciled=true. <br /></i><br /> Bryce Nesbitt wrote: <blockquote
cite="mid:46DD0E81.2000901@obviously.com"type="cite"> ...Which is all good. But the Hibernate version of query still
takesseveral seconds, and still appears in my pg_log slow query log:<br /><br /><tt>LOG: duration: 2248.662 ms
statement:EXECUTE C_51443 [PREPARE: select count(vehicleeve0_.VEHICLE_EVENT_ID) as x0_0_ from EG_VEHICLE_EVENT
vehicleeve0_where (vehicleeve0_.CSO_ID=$1 )and(vehicleeve0_.RECONCILED=$2 )]</tt></blockquote>