<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Richard Huxton provided the answer: <i>It's a prepared query-plan,
which means it can't plan to use the index because the next EXECUTE
might have reconciled=true.
<br>
</i><br>
Bryce Nesbitt wrote:
<blockquote cite="mid:46DD0E81(dot)2000901(at)obviously(dot)com" type="cite">
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
...Which is all good. But the Hibernate version
of query still takes several 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>
</body>
</html>