Home > database >  Analyze table for Oracle
Analyze table for Oracle

Time:09-26

Hello, everybody CSDN Daniel!
My small white a
Today Oracle stored procedures and encounter a strange question,
To select the insert data into a temporary table time special long (note: this table is used for the first time in the course of the storage, and was clear from the start)
Then I will insert and select copy this passage outside to perform alone, to correct the data and time is very short (normal),
Later consulting department colleagues, colleagues suggest in inserted into a temporary table, this
to execute the following statementsThe execute immediate 'analyze table temporary table compute statistics';
Add after, so he can run smoothly,
Then I asked my colleague, why do you want to do this, he said also don't know, only know before encountered this problem is doing just that,
Finally, I was encouraging you guys came to CSDN to Daniel consulted,
For the first time to post, please advice!

Q: what are the reasons for the above problems? Analyze what is the nature of the table?

CodePudding user response:

Arguably, should not happen, determine the analyze is insert table? Rather than select the table in the query? Or, insert table itself also appear in the select query? If not, then this method is no universality,

In addition you said the select and insert each perform all soon? Insert the select clause followed, only keep up with the values is a legitimate insert statement, don't know how you insert? And select queries perform alone soon also very suspicious, with what tools? Returns all the results of the data?

CodePudding user response:

Forgot to say,

Analyze the essence of the tables of various statistics, such as how many data table? How the distribution of table data, and so on, in fact, at the end of the 9 I, oracle recommends using dbms_stats package to complete statistics collection, analyze the command is used, it has some defects, such as not parallel, such as collecting the partition table has some problems, and so on,

CodePudding user response:

The original poster is what kind of a temporary table?

Temporary?

CodePudding user response:

Analyze the nature of the table is collecting table (data) statistics, next time in the operation of the table, can save some time resolution, so the retrieval speed will much faster,

CodePudding user response:

reference 4 floor qq646748739 response:
analyze the essence of the table is collecting table (data) statistics, next time in the operation of the table, can save some time resolution, so the retrieval speed will naturally a lot faster,


Importantly may generate better execution plans, born of the dynamic sampling time is almost negligible,,,

CodePudding user response:

Temporary table data is to use the delete, temporary tables can number indexes, such as data deleted, but there is no edge, statistics analysis to increase the update table information table is only for the execution plan. Oracle execution plan automatically choose the optimal according to table statistics method. Or you built a few tables, if temporary table data is delete all suggest using turncate table xx!
  • Related