Reputation: 23
I am using Oracle database. When I am creating a primary key, the index is automatically created for me, but when I delete some row does the index automatically updated? Because after creating index for my custom column I should rebuild index (can I achieve 'automatic update' as in primary key case? if yes, how? and what disadvantages of 'automatic update' vs manual rebuild?)
Upvotes: 0
Views: 226
Reputation: 11591
Indexes are maintained automatically by the database in all cases, unless you explicitly tell the database not to.
Similarly, it is (very) rare that you need to rebuild or perform any regular "maintenance" for an index. In the vast majority of cases, they will handle themselves just fine.
For more details on why is this is the case, you can explore the topic more with my video on the topic
Upvotes: 1