Re: Partial index on boolean - Sometimes fails to index scan

From: Bryce Nesbitt <bryce1(at)obviously(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Partial index on boolean - Sometimes fails to index scan
Date: 2007-09-04 14:40:04
Message-ID: 46DD6E44.4000505@obviously.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

<!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>

Attachment Content-Type Size
unknown_filename text/html 941 bytes

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2007-09-04 15:03:08 Re: Cast on character columns in views
Previous Message Scott Marlowe 2007-09-04 14:11:18 Re: How to influence the planner