Andrew Nesheret wrote:
> Richard Huxton wrote:
>> If you PREPARE .... then EXECUTE the same query, does it still use the
>> index?
> Done, same result.
> --- Code ---
> stmt = connection.prepareStatement( "explain analyze SELECT 1 FROM
> ONLY sf_ipv4traffic x WHERE ? OPERATOR(pg_catalog.=) node FOR SHARE OF
> x" );
> stmt.setLong( 1, 2004 );
> rs = stmt.executeQuery();
> while(rs.next())
> {
> System.out.println( rs.getString(1) );
> }
No, this will produce different plans - what happens if you supply each
parameter in turn - the second plan should stay the same as the first.
--
Richard Huxton
Archonet Ltd