It appears that the page you are looking for does not exist or has been moved elsewhere.

If you keep ending up here, please head back to our homepage or try the search form below.

There is also an analyze command that you can use to generate statistics.

updating statistics in oracle-64updating statistics in oracle-54

This is the number of rows that the query will process. In this case, Oracle knew (or in most cases it's a good guess) we would process 100 rows because we generated statistics on the EMP table after we created the table.

How did Oracle know that it was going to process 100 rows. The optimizer uses these statistics to generate execution plans.

The optimizer program uses statistics on tables and on the indexes surrounding those tables, so it's important to have statistics on both.

In the next section, we will show you how to generate statistics on tables and indexes in your database.

Starting with the introduction of the dbms_stats package, Oracle provides a simple way for the Oracle professional to collect statistics for the CBO.

The old-fashioned analyze table and dbms_utility methods for generating CBO statistics are obsolete and somewhat dangerous to SQL performance because they don't always capture high-quality information about tables and indexes.Oracle requires statistics on both tables and any associated indexes (we will talk about indexes next), and most of the time you will generate both with just one command. Also, in Oracle database 10g and beyond you have the ability to gather system statistics and fixed view statistics.Let's look at each of these operations in a bit more detail next.To always choose the best execution plan for a SQL query, Oracle relies on information about the tables and indexes in the query.Once the optimizer has done its job, it provides an execution plan to Oracle.Since we included the cascade command, the indexes will also have statistics generated on them.