Search Postgresql Archives

Re: foreign key constraint, planner ignore index.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

              http://archives.postgresql.org/

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux