Created
October 3, 2014 07:55
-
-
Save velll/66e6ea297ee5a4748d85 to your computer and use it in GitHub Desktop.
Delete and index 1M rows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE TABLE test_index_delete( | |
| num NUMBER) | |
| INSERT INTO test_index_delete | |
| SELECT 1000238674 + LEVEL | |
| FROM DUAL | |
| CONNECT BY LEVEL <= 1000000 | |
| commit | |
| select * from test_index_delete order by num asc | |
| begin | |
| for i in 1..100 | |
| loop | |
| delete from test_index_delete where num < 1000238711 + i*10; | |
| end loop; | |
| end; | |
| 2.636 | |
| rollback | |
| create index test_index_delete_idx on test_index_delete( | |
| num asc) | |
| tablespace hydra_index | |
| 0.04 | |
| begin | |
| for i in 1..100 | |
| loop | |
| delete from test_index_delete where num < 1000238711 + i*10; | |
| end loop; | |
| end; | |
| rollback |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment