Indexes in relational databases: Can indexes generally be created or dropped at any time (subject to privileges and workload considerations)?

Difficulty: Easy

Correct Answer: Applies — DDL allows CREATE/DROP INDEX whenever permitted

Explanation:


Introduction / Context:
Indexes are physical structures that accelerate lookups, joins, and ordering. Understanding their lifecycle operations is key to tuning.



Given Data / Assumptions:

  • Standard DDL statements CREATE INDEX and DROP INDEX exist (syntax varies slightly by vendor).
  • Proper privileges are required.
  • Online/CONCURRENT options may be available to reduce locking.



Concept / Approach:
Administrators and developers add indexes to improve performance and drop them when they are unused or harmful. While you can issue these commands at any time, you must account for locks, resource usage, and potential impact on DML throughput.



Step-by-Step Solution:
Confirm that the DBMS supports index DDL independent of table creation.Ensure necessary privileges and consider “online” options if available.Execute CREATE/DROP as needed; monitor performance and storage.Recognize that queries can benefit immediately after creation.



Verification / Alternative check:
DBMS manuals show index DDL executed outside of table DDL.



Why Other Options Are Wrong:
Indexes are not limited to initial table creation, nor do they require table drops to remove.



Common Pitfalls:
Creating redundant or overlapping indexes; ignoring maintenance overhead on INSERT/UPDATE/DELETE.



Final Answer:
Applies — DDL allows CREATE/DROP INDEX whenever permitted

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion