From: | Andrew Nesheret <andrew(at)infinet(dot)ru> |
---|---|
To: | Richard Huxton <dev(at)archonet(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: foreign key constraint, planner ignore index. |
Date: | 2007-12-20 06:20:12 |
Message-ID: | 476A099C.2010102@infinet.ru |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2007-12-20 07:12:18 | Re: Way to avoid expensive Recheck Cond in index lookup? |
Previous Message | Andrew Nesheret | 2007-12-20 06:18:36 | Re: foreign key constraint, planner ignore index. |