Database Indexing: Which Options Are Used for Indexing?
In relational database systems, indexing is primarily about building data structures (e.g., tree-based structures) that accelerate lookups for queries. A B-tree is a classic, widely used indexing data structure that keeps keys in sorted order and supports efficient searching, insertion, and deletion.
By contrast:
- A transaction log is used for durability and recovery (e.g., to ensure the database can be restored after failures), not to speed up query lookups via key-to-row mappings.
- A view is a stored query definition that provides a way to present data; it is not itself the physical indexing structure used by the storage engine for search.
- A trigger is stored logic that executes automatically in response to data modifications; it is not an indexing method.
Therefore, among (i) Transaction log, (ii) B-tree, (iii) Views, (iv) Triggers, the correct choice used for indexing is (ii) B-tree.
Key terms you’ll see in this topic:
- Index
- B-tree
- Transaction log
- View
- Trigger
Footnotes
-
Wikipedia - B-tree. https://en.wikipedia.org/wiki/B-tree - Describes B-trees as balanced tree data structures commonly used in databases and file systems as index structures. ↩ ↩2
-
Wikipedia - Transaction log. https://en.wikipedia.org/wiki/Transaction_log - Explains that the transaction log records changes for durability and recovery. ↩
-
Wikipedia - View (database). https://en.wikipedia.org/wiki/View_(database) - Defines views as stored queries that present data as virtual tables. ↩
-
Wikipedia - Database trigger. https://en.wikipedia.org/wiki/Database_trigger - Describes triggers as procedures that execute automatically in response to certain events. ↩
Database Indexes (B-Trees) Explained
Why B-tree is used for indexing
A B-tree organizes index keys in a balanced tree structure to minimize the number of disk/page accesses needed to locate matching records. This is why B-tree (and related variants like B+ trees) are common index structures in DB engines.
Why the other options are not “used for indexing”
- Transaction log: It supports recovery by recording database changes so the system can undo/redo operations during restart; it is not a structure for accelerating “find rows by key” operations.
- Views: They are logical query definitions. While query planners may sometimes use indexes underneath a view’s underlying tables, the view itself is not the index data structure.
- Triggers: They implement behavior (auto-execution on events). They may affect what data gets written, but they are not the index structure used to speed retrieval.
Footnotes
-
Wikipedia - B-tree. https://en.wikipedia.org/wiki/B-tree - Describes B-trees as balanced tree data structures commonly used in databases and file systems as index structures. ↩
-
Wikipedia - Transaction log. https://en.wikipedia.org/wiki/Transaction_log - Explains that the transaction log records changes for durability and recovery. ↩
-
Wikipedia - View (database). https://en.wikipedia.org/wiki/View_(database) - Defines views as stored queries that present data as virtual tables. ↩
-
Wikipedia - Database trigger. https://en.wikipedia.org/wiki/Database_trigger - Describes triggers as procedures that execute automatically in response to certain events. ↩
Elimination method for MCQ on ‘used for indexing’
- 1Step 1
Indexing is about data structures that accelerate record retrieval by key (e.g., B-tree).
- 2Step 2
Transaction log → durability/recovery; View → stored query; Trigger → automatic event-handling.
- 3Step 3
B-tree matches because it is an index data structure for fast lookup.
- 4Step 4
Choose (ii) B-tree.
Option-by-Option Role vs. Indexing
How each option primarily relates to indexing (high = directly an indexing mechanism).
Common exam confusions
Exam strategy
When asked ‘used for indexing,’ look for answers that are explicitly index structures (like B-tree). Avoid items that primarily describe recovery, presentation (view), or event behavior (trigger).
Footnotes
-
Wikipedia - B-tree. https://en.wikipedia.org/wiki/B-tree - Describes B-trees as balanced tree data structures commonly used in databases and file systems as index structures. ↩
Don’t confuse indexing with query features
Views and triggers are logical/behavioral constructs. An index is a physical/engine structure designed to accelerate search by keys (e.g., B-tree). 2
Footnotes
-
Wikipedia - View (database). https://en.wikipedia.org/wiki/View_(database) - Defines views as stored queries that present data as virtual tables. ↩
-
Wikipedia - Database trigger. https://en.wikipedia.org/wiki/Database_trigger - Describes triggers as procedures that execute automatically in response to certain events. ↩
Indexing MCQ Quick Recall
Knowledge Check
Which of the following is used for indexing in database systems?
Explore Related Topics
Which Thread Type Is Managed Directly by the Operating System Kernel?
Kernel-level threads are the only thread type that the operating system kernel creates, schedules, and manages directly.
- Managed by the OS kernel, visible to the scheduler, and allow true parallel execution with isolated blocking.
- User‑level threads are handled by a user‑space library, are not seen by the kernel, and a blocking call can stall the whole process.
- Kernel threads have higher creation and context‑switch overhead but give better responsiveness and multicore scalability.
- In the MCQ, the correct answer is (ii) kernel‑level thread; the other options describe usage or count, not kernel management.
Lexical Analysis and the Main Structure Used: Finite Automata
Lexical analysis relies on finite automata—typically deterministic finite automata (DFA)—to recognize token patterns defined by regular expressions.
- Regular expressions for identifiers, numbers, etc., are converted to NFAs then to a DFA for fast scanning.
- The DFA processes the source character by character, tracking a single current state and emitting a token at each accepting state.
- Queues, stacks, and trees support other compiler phases (parsing, AST construction) but are not the primary model for token recognition.
- Lexers output a stream of tokens that the parser consumes for syntax analysis.
Object-Based Logical Models: Logical, View, or Physical Level?