dynamobi/dynamobi — Issue #532: [FRG-340] with JDBC foreign data wrapper lenient=false, and foreign table already defined in LucidDB catalog, skip retrieving metadata for the cursor
Author: dynamobi-build
Created: 2011-12-30 03:33:42+00:00
State: open
Labels: FRG, JDBC Foreign Data Wrapper

[reporter="jvs", created="Tue, 2 Sep 2008 12:37:32 -0500 (GMT-05:00)"]
Currently we always prepare a statement like "select * from t" and get metadata for it. But if we already have a table definition in the catalog, and lenient=false, this is superfluous. (Unless we want to cross-check our catalog metadata against the latest from the source and throw an exception if they mismatch, which is something we don't currently do; we could still avoid it in that case by deferring the check until after we've executed the real query we're going to fetch from.)

The motivation for this improvement is that if the JDBC driver for the source DBMS doesn't support retrieval of metadata before execution (both Oracle and MySQL suffer from this limitation), then we end up executing the full-table select and then not fetching any rows; this may put unnecessary load on the source, e.g. if it starts prefetching data even though we don't actually fetch any of it.