If you have access to Oracle Metalink (MyOracleSupport, or what they call today), find bug # 2475998, DRAMATIC DROP IN PERFORMANCE, USING SYNONYMS BY SETINCLUDESYNONYMS. The applicant reported a 60-fold deterioration in the performance of DatabaseMetadata.getColumns () when synonyms exist. Oracle recommends getting the metadata in some other way, for example. execute a dummy request and get ResultSetMetaData.
Also see Jack Shirazi Java Performance Tuning , which has a section for retrieving database metadata . (link to extract from Google Books)
Bottom line: do not use DatabaseMetadata.getColumns ().
source
share