Thursday, July 7, 2016

Estimate the index size before creating the INDEX

explain plan for
2 create index myapp.order_record_idx01 on myapp.order_record (ORDER_ID,ITEM_NAME)
3 tablespace APPDATA;
 
 
Explained.
 
 
SQL> select * from table(dbms_xplan.display);
 
PLAN_TABLE_OUTPUT
----------------------------------------------------------------------------------------------------------------
Plan hash value: 3190873030
 
-------------------------------------------------------------------------------------------------------------
| Id  | Operation              | Name               | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |
-------------------------------------------------------------------------------------------------------------
|   0 | CREATE INDEX STATEMENT |                    |    11M|   197M| 22802   (1)| 00:00:01 |       |       |
|   1 |  INDEX BUILD NON UNIQUE| ORDER_RECORD_IDX01 |       |       |            |          |       |       |
|   2 |   SORT CREATE INDEX    |                    |    11M|   197M|            |          |       |       |
|   3 |    PARTITION RANGE ALL |                    |    11M|   197M| 14956   (2)| 00:00:01 |     1 |     6 |
|   4 |     TABLE ACCESS FULL  | ORDER_RECORD       |    11M|   197M| 14956   (2)| 00:00:01 |     1 |     6 |
-------------------------------------------------------------------------------------------------------------
 
Note
-----
   - estimated index size: 377M bytes
 
15 rows selected.
 
 
 
 Note: The index size is just estimation, size may vary based on table statistics.



 
 
 
 
 
 
 
 
 
 
 

No comments:

Post a Comment