Search Postgresql Archives

Re: foreign key constraint, planner ignore index.

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

 



Forget to add test source code.
--- code ---

     long [] IDs = new long[] {
                                2007, // no references
156 // all rows in sf_ipv4traffic referenced to };

stmt = connection.prepareStatement( "explain analyze SELECT 1 FROM ONLY sf_ipv4traffic x WHERE ? OPERATOR(pg_catalog.=) node FOR SHARE OF x" ); for ( long nodeID : IDs )
     {
       stmt.setLong( 1, nodeID );
       rs = stmt.executeQuery();
       System.out.println( "Result for node #" + nodeID );
       while ( rs.next() )
         System.out.println( "  " + rs.getString( 1 ) );
     }
     rs.close();
     connection.close();
---

--
__________________________________
WBR, Andrew Nesheret ICQ:10518066


---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
      choose an index scan if your joining column's datatypes do not
      match

[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