I think this feature came around ages ago (10.2?) but I’m still always impressed by it every time I use it.
You can run EXPLAIN on a CREATE INDEX command
SQL> explain plan for create index IX on MY_TABLE ( bet_account_num );
Explained.
--------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
--------------------------------------------------------------------------------------
| 0 | CREATE INDEX STATEMENT | | 213K| 626K| 833 (1)| 00:00:11 |
| 1 | INDEX BUILD NON UNIQUE| IX | | | | |
| 2 | SORT CREATE INDEX | | 213K| 626K| | |
| 3 | TABLE ACCESS FULL | MY_TABLE | 213K| 626K| 712 (2)| 00:00:09 |
--------------------------------------------------------------------------------------
Note
-----
- estimated index size: 5128K bytes
and you get a nice little estimate of how big your index will be…..Awesome!
Got some thoughts? Leave a comment