Question:
What is true about an index?
इंडेक्स के बारे में क्या सच है?
Options:
- Index increases performance even if the table is frequently updated
- It makes harder work for the SQL Server engine to work on indexes that have large keys
- It is not difficult for the SQL Server engine to work on indexes with large keys
- None of these
- इंडेक्स प्रदर्शन को बढ़ााता है भले ही तालीका का अक्सर अद्यतन किया जाता है
- यह एसक्यूएल सर्वर इंजन के लिए इंडेक्स पर काम करने के लिए कठिन काम करता है, जिसमें बड़ीी की हैं
- एसक्यूएल सर्वर इंजन के लिए इंडेक्स पर बड़ेे पैमाने पर काम करने के लिए काम करना मुश्किल नहींं होता है
- इनमे से कोई नहींं
Correct Answer: b)
Explanation:
Detailed Explanation:
The correct answer is b) It makes it harder/more work for the SQL Server engine to work on indexes that have large keys (यह एसक्यूएल सर्वर इंजन के लिए इंडेक्स पर काम करने के लिए कठिन काम करता है, जिसमें बड़ी की हैं).
Database Index Architecture & Key Size Impact:
- Database indexes are structured as balanced trees (B-Trees). Index pages in engines like Microsoft SQL Server have a fixed size of 8 KB (8192 bytes).
- Impact of Large / Wide Keys: When an index key consists of large or wide columns (e.g., composite keys or long character strings), each index page can hold fewer index keys (lower fan-out). This causes:
- The B-Tree must become taller (increased index depth/height).
- The database engine must execute more page I/O read operations to traverse from the root node to the leaf level.
- Cache efficiency drops because index pages consume excessive memory in the buffer pool.
- Write overhead increases significantly during
INSERT,UPDATE, andDELETEoperations due to frequent page splits.
- Why Option (a) is False: If a table is frequently updated, indexes actually degrade overall write performance because the database engine must constantly update the index tree for every change.
विस्तृत व्याख्या:
सही उत्तर b) यह एसक्यूएल सर्वर इंजन के लिए इंडेक्स पर काम करने के लिए कठिन काम करता है, जिसमें बड़ी की हैं है।
डेटाबेस इंडेक्स और बड़ी कुंजियों का प्रभाव:
- एसक्यूएल सर्वर में इंडेक्स B-Tree (संतुलित ट्री) संरचना में 8 KB के पेज में संग्रहीत होते हैं।
- यदि इंडेक्स कुंजी (Index Key) का आकार बहुत बड़ा (Wide Key) है, तो प्रत्येक 8 KB पेज में कम कुंजियाँ समा पाती हैं (कम फैन-आउट)। इसके परिणामस्वरूप:
- B-Tree की गहराई (Height) बढ़ जाती है, जिससे सर्चिंग के दौरान डिस्क I/O ऑपरेशन्स बढ़ जाते हैं।
- मेमोरी बफर पूल में इंडेक्स अधिक स्थान घेरता है।
- डेटा इंसर्ट, अपडेट या डिलीट होने पर B-Tree में पेज स्प्लिट्स अधिक होते हैं, जिससे इंजन पर कार्यभार (Overhead) काफी बढ़ जाता है।
- विकल्प (a) असत्य है क्योंकि यदि किसी टेबल पर बार-बार अपडेट होते हैं, तो इंडेक्स बनाए रखने के कारण प्रदर्शन में गिरावट आती है।