Re: Partial index on boolean - Sometimes fails to index scan - Mailing list pgsql-sql

From Bryce Nesbitt
Subject Re: Partial index on boolean - Sometimes fails to index scan
Date
Msg-id 46DD6E44.4000505@obviously.com
Whole thread Raw
In response to Partial index on boolean - Sometimes fails to index scan  (Bryce Nesbitt <bryce1@obviously.com>)
Responses Trigger to change different row in same table
List pgsql-sql
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> 

pgsql-sql by date:

Previous
From: "Scott Marlowe"
Date:
Subject: Re: How to influence the planner
Next
From: Tom Lane
Date:
Subject: Re: Cast on character columns in views