This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
When connecting and viewing table structures using the oracle classes12.jar, the database explorer runs oracle statistics on these tables. This has direct consequences in regards to the execution plan that the oracle optimiser uses when executing sql statements. This should definitely not be the default behaviour as this is a oracle DBA type role, rather than a developer role. Currently if the oracle database being used is running a rule based optimiser for executing sql statements, than statistics are being generated for the tables being viewed, and can seriously impact query perfomance as the table being analysed will be based on a cost based optimiser. Because of this any sql statements being executed will be forced to run using the cost based optimiser.
I'm not aware of anything in the database explorer causing the statistics to be generated. The database explorer only connnects to the database, asks for DatabaseMetaData and calls methods on it for retrieving the database structure. But I'm not an Oracle expert. Do you know what exactly causes it?
It is definitely no P1 by Bug Priority Guidelines, see: http://qa.netbeans.org/processes/bug_priority_guidelines.html I expect that it is default behaviour of oracle driver, do you have a idea how to change it?
I am not an expert either. I captured the SQL being sent to the database. The first call is "analyze table XYZ compute statistics". That will cause the database to update it's statistics. Not only is that a bad thing to do from netbeans (it's a DBA activity), it is a very slow process, and it makes it seem that either 1) netbeans is hanging (if you do have the privileges to run statistics) or 2) netbeans is broken (if you do not have the privileges to run statistics). The solution is to remove any reference to compute statistics from the code. I do not know of any database platform where the "compute statistics" call would be acceptable. It is P1 based on at least the following items from the guidelines: # Severe regression in performance of a feature # Very bad UI responsiveness of a feature making the feature unusable Displaying a table's indices -- or viewing any information about a table -- takes 10-15 minutes on many tables (and they are not that large). If someone were to point me to the location of the code for showing the table's indices or the initial view a table's information, I would be happy to try to find the cause of the problem.
I agree that NetBeans should in no way explicitly cause the statistics to be created. However, I don't believe NetBeans does it. I looked at the code and there's no place where the "analyze table" command is sent to the database. Really look the driver is the culprit, but I will investigate more. In the mean time, do you think you could try to connect with another driver?
Hi all, Im using with Netbeans the standard driver which was issued by Oracle. I am using this to connect to an Oracle database.
As I said in a previous post, nothing in NetBeans explicitly executes the ANALYZE TABLE statement. However, I grepped the classes in classes12.zip for this string and it is contained in the oracle.jdbc.OracleDatabaseMetaData class. Probably the driver needs to analyze the table this in order to retrieve the columns CARDINALITY and PAGES in the ResultSet returned by DMD.getIndexInfo(). This is not a defect in NetBeans, so closing. If you have any idea how to workaround the driver behavior, file a new ENHANCEMENT issue.
Additional user information: ---------------------------- .... I believe the problem is here: ResultSet rs = dmd.getIndexInfo(drvSpec.getCatalog(), drvSpec.getSchema(), table, false, false); The last parameter is 'approximate' - when true, result is allowed to reflect approximate or out of data values; when false, results are requested to be accurate Because the parm is set to false, Oracle (and some other databases, I would surmise) runs update statistics to gather the accurate data. Setting the parm to true will cause Oracle to respond with the results from the last run of statistics. ....
Fixed by retrieving the indexes using aproximate = true. Checking in org/netbeans/modules/db/explorer/actions/AddToIndexAction.java; /cvs/db/src/org/netbeans/modules/db/explorer/actions/AddToIndexAction.java,v <-- AddToIndexAction.java new revision: 1.28; previous revision: 1.27 done Checking in org/netbeans/modules/db/explorer/dlg/AddTableColumnDialog.java; /cvs/db/src/org/netbeans/modules/db/explorer/dlg/AddTableColumnDialog.java,v <-- AddTableColumnDialog.java new revision: 1.35; previous revision: 1.34 done Checking in org/netbeans/modules/db/explorer/infos/IndexListNodeInfo.java; /cvs/db/src/org/netbeans/modules/db/explorer/infos/IndexListNodeInfo.java,v <-- IndexListNodeInfo.java new revision: 1.30; previous revision: 1.29 done Checking in org/netbeans/modules/db/explorer/infos/IndexNodeInfo.java; /cvs/db/src/org/netbeans/modules/db/explorer/infos/IndexNodeInfo.java,v <-- IndexNodeInfo.java new revision: 1.33; previous revision: 1.32 done Checking in org/netbeans/modules/db/explorer/infos/TableNodeInfo.java; /cvs/db/src/org/netbeans/modules/db/explorer/infos/TableNodeInfo.java,v <-- TableNodeInfo.java new revision: 1.40; previous revision: 1.39 done Checking in org/netbeans/modules/db/explorer/nodes/IndexNode.java; /cvs/db/src/org/netbeans/modules/db/explorer/nodes/IndexNode.java,v <-- IndexNode.java new revision: 1.25; previous revision: 1.24 done
VERIFIED
*** Issue 88097 has been marked as a duplicate of this issue. ***