Re: foreign key constraint, planner ignore index. - Mailing list pgsql-general

From Andrew Nesheret
Subject Re: foreign key constraint, planner ignore index.
Date
Msg-id 476A099C.2010102@infinet.ru
Whole thread Raw
In response to Re: foreign key constraint, planner ignore index.  (Andrew Nesheret <andrew@infinet.ru>)
List pgsql-general
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


pgsql-general by date:

Previous
From: Andrew Nesheret
Date:
Subject: Re: foreign key constraint, planner ignore index.
Next
From: Tom Lane
Date:
Subject: Re: Way to avoid expensive Recheck Cond in index lookup?