Q1. How do indexes work in MongoDB and what is a compound index?
An index is a B-tree structure storing a sorted subset of a collection's fields, letting the planner find documents without scanning everything. Without an index a query ...
Technical Question Bank · Peer-Reviewed
Search and filter frequently asked interview questions across technical, programming, and behavioral domains. Tailor your interview preparation by difficulty for freshers or experienced developers (8 available).
An index is a B-tree structure storing a sorted subset of a collection's fields, letting the planner find documents without scanning everything. Without an index a query ...
**Declarative (non-procedural)**. You state *what* result you want, not *how* to compute it. The database's **query optimizer** decides the "how" — which indexes to use, ...
A clustered index defines the physical order of rows in the table. Because the data is stored in that order, a table can have only one clustered index, usually the primar...
Query optimisation starts by measuring. `EXPLAIN` shows the plan; `EXPLAIN ANALYZE` runs it and reports actual rows and time. Things to look for: sequential scans on larg...
Permanently removes the table definition, all data, indexes, triggers, and constraints. **Cannot be undone** (unless in a transaction that rolls back, in some DBs). ```sq...
Data structures (typically B-Trees) that speed up data retrieval at the cost of slower writes and extra storage. Think of them as a book's table of contents.
- **Clustered**: Determines physical storage order. One per table. The data IS the index. - **Non-Clustered**: Separate structure with pointers to data. Multiple allowed ...
**Query optimization**. The database's query optimizer generates multiple execution plans and picks the cheapest one based on statistics, indexes, and cost models. You ca...
HireXTech uses essential storage to remember your study preferences and third-party advertising cookies via Google AdSense in compliance with GDPR. You can choose to enable essential cookies only or accept all cookies. Read our Privacy Policy.