pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bryce Nesbitt <bryce1@obviously.com>
To: pgsql-sql@postgresql.org
Subject: Re: Partial index on boolean - Sometimes fails to index scan
Date: Tue, 04 Sep 2007 07:40:04 -0700
Message-ID: <46DD6E44.4000505@obviously.com> (raw)
In-Reply-To: <46DD0E81.2000901@obviously.com>
References: <46DCE263.6040207@obviously.com>
	<46DD0E81.2000901@obviously.com>

<!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.2000901@obviously.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>



view thread (2+ messages)

Message-ID: <46DD6E44.4000505@obviously.com>
Permalink:  ../46DD6E44.4000505@obviously.com/
Also on:    postgresql.org/message-id/46DD6E44.4000505@obviously.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: bryce1@obviously.com
  Subject: Re: Partial index on boolean - Sometimes fails to index scan
  In-Reply-To: <46DD6E44.4000505@obviously.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox