DBMS — MCQ Practice

Hindi aur English dono mein practice karo — click karo answer check karne ke liye

📚 136 Questions 🌐 Hindi + English ✅ Free
भाषा / Language:
136 questions
91
EN + हिं Easy
GB What are index statistics and why are they critical for query optimization?
IN सूचकांक आँकड़े क्या हैं और वे क्वेरी अनुकूलन के लिए महत्वपूर्ण क्यों हैं?
A
Statistical information about index column value distribution (cardinality histograms null count average row size) that the query optimizer uses to estimate result sizes and costs for different execution plan choices - stale or inaccurate statistics lead to poor plan choices सूचकांक स्तंभ मूल्य वितरण के बारे में सांख्यिकीय जानकारी (कार्डिनैलिटी हिस्टोग्राम शून्य गणना औसत पंक्ति आकार) जिसका उपयोग क्वेरी ऑप्टिमाइज़र विभिन्न निष्पादन योजना विकल्पों के लिए परिणाम आकार और लागत का अनुमान लगाने के लिए करता है - पुराने या गलत आँकड़े खराब योजना विकल्पों का कारण बनते हैं
B
The storage statistics for index pages अनुक्रमणिका पृष्ठों के लिए भंडारण आँकड़े
C
The timing statistics for index lookup operations इंडेक्स लुकअप ऑपरेशन के लिए समय आँकड़े
D
The count of distinct values in an index किसी सूचकांक में भिन्न मानों की गिनती
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Index statistics: the optimizer uses cardinality (distinct values), histograms (value distribution), null percentage, correlation (physical sort order vs. key order). Used to estimate: rows returned by predicate, join selectivity, cost of index scan vs. full scan. ANALYZE TABLE (MySQL) / ANALYZE (PostgreSQL) updates statistics.
व्याख्या (हिन्दी) सूचकांक आँकड़े: ऑप्टिमाइज़र कार्डिनैलिटी (विशिष्ट मान), हिस्टोग्राम (मूल्य वितरण), शून्य प्रतिशत, सहसंबंध (भौतिक क्रम क्रम बनाम कुंजी क्रम) का उपयोग करता है। अनुमान लगाने के लिए उपयोग किया जाता है: विधेय द्वारा लौटाई गई पंक्तियाँ, चयनात्मकता में शामिल होना, सूचकांक स्कैन बनाम पूर्ण स्कैन की लागत। तालिका (MySQL) का विश्लेषण करें / (PostgreSQL) अद्यतन आँकड़ों का विश्लेषण करें।
92
EN + हिं Medium
GB What is the difference between index seek and index scan in query execution plans?
IN क्वेरी निष्पादन योजनाओं में इंडेक्स सीक और इंडेक्स स्कैन के बीच क्या अंतर है?
A
Index scan is always faster than index seek इंडेक्स स्कैन हमेशा इंडेक्स सीक से तेज़ होता है
B
Index seek is for range queries; index scan for equality इंडेक्स सीक रेंज प्रश्नों के लिए है; समानता के लिए सूचकांक स्कैन
C
Index seek: uses the B-tree to navigate directly to the matching key value(s) - O(log n) + matching rows only. Index scan: reads all (or most) leaf pages of the index sequentially - O(index_size). Seek is much faster for selective queries; scan used when large fraction of data is returned or index cannot be used for point lookup इंडेक्स सीक: मिलान कुंजी मान (मानों) - ओ (लॉग एन) + केवल मिलान पंक्तियों पर सीधे नेविगेट करने के लिए बी-ट्री का उपयोग करता है। इंडेक्स स्कैन: इंडेक्स के सभी (या अधिकांश) लीफ पेजों को क्रमिक रूप से पढ़ता है - O(index_size)। चयनात्मक प्रश्नों के लिए सीक बहुत तेज़ है; स्कैन का उपयोग तब किया जाता है जब डेटा का बड़ा हिस्सा लौटाया जाता है या पॉइंट लुकअप के लिए इंडेक्स का उपयोग नहीं किया जा सकता है
D
Index seek is for non-indexed columns; index scan for indexed इंडेक्स सीक गैर-अनुक्रमित कॉलम के लिए है; अनुक्रमित के लिए सूचकांक स्कैन
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Seek: optimizer has a selective predicate (WHERE id=42) -> traverse B-tree from root to leaf O(log n). Fast for selective queries. Scan: predicate is not very selective or no matching index -> read all leaf pages sequentially. For covering index scans, scanning may still be efficient if sequential I/O.
व्याख्या (हिन्दी) खोजें: ऑप्टिमाइज़र के पास एक चयनात्मक विधेय है (जहां आईडी = 42) -> बी-ट्री को जड़ से पत्ती ओ (लॉग एन) तक पार करें। चयनात्मक प्रश्नों के लिए तेज़. स्कैन: विधेय बहुत चयनात्मक नहीं है या कोई मिलान सूचकांक नहीं है -> सभी पत्ती पृष्ठों को क्रमिक रूप से पढ़ें। इंडेक्स स्कैन को कवर करने के लिए, अनुक्रमिक I/O होने पर स्कैनिंग अभी भी कुशल हो सकती है।
93
EN + हिं Easy
GB What is CREATE INDEX CONCURRENTLY in PostgreSQL and what trade-offs does it involve?
IN PostgreSQL में क्रिएट इंडेक्स समसामयिक रूप से क्या है और इसमें कौन से ट्रेड-ऑफ शामिल हैं?
A
Building an index without holding a table lock (allows concurrent reads AND writes during index build) - trade-offs: takes longer than normal index creation (multiple table scans needed) uses more CPU/I/O cannot be done in a transaction and may fail requiring manual REINDEX टेबल लॉक रखे बिना इंडेक्स बनाना (इंडेक्स निर्माण के दौरान समवर्ती पढ़ने और लिखने की अनुमति देता है) - ट्रेड-ऑफ: सामान्य इंडेक्स निर्माण से अधिक समय लगता है (एकाधिक टेबल स्कैन की आवश्यकता होती है) अधिक सीपीयू/आई/ओ का उपयोग लेनदेन में नहीं किया जा सकता है और मैन्युअल रीइंडेक्स की आवश्यकता विफल हो सकती है
B
Creating an index across multiple concurrent sessions एकाधिक समवर्ती सत्रों में एक सूचकांक बनाना
C
Creating an index that only works for concurrent queries एक सूचकांक बनाना जो केवल समवर्ती प्रश्नों के लिए काम करता है
D
Creating multiple indexes simultaneously एक साथ कई इंडेक्स बनाना
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) CREATE INDEX CONCURRENTLY: avoids ACCESS EXCLUSIVE lock. Process: (1) Register index in catalog. (2) First table scan - build initial index. (3) Second scan - incorporate changes from DML during first scan. (4) Final validation. Takes 2-3x longer. Downside: cannot be in transaction, if fails leaves invalid index needing cleanup.
व्याख्या (हिन्दी) समवर्ती रूप से इंडेक्स बनाएं: एक्सेस एक्सक्लूसिव लॉक से बचें। प्रक्रिया: (1) कैटलॉग में सूचकांक पंजीकृत करें। (2) पहला टेबल स्कैन - प्रारंभिक सूचकांक बनाएं। (3) दूसरा स्कैन - पहले स्कैन के दौरान डीएमएल से परिवर्तन शामिल करें। (4) अंतिम सत्यापन. 2-3x अधिक समय लगता है. नकारात्मक पक्ष: लेनदेन में नहीं हो सकता, यदि विफल रहता है तो अमान्य सूचकांक को सफाई की आवश्यकता होती है।
94
EN + हिं Easy
GB What is a GiST (Generalized Search Tree) index in PostgreSQL and what data types does it support?
IN PostgreSQL में GiST (सामान्यीकृत खोज वृक्ष) सूचकांक क्या है और यह किस डेटा प्रकार का समर्थन करता है?
A
An index for geographic spatial data only केवल भौगोलिक स्थानिक डेटा के लिए एक सूचकांक
B
An extensible index framework that supports a wide variety of data types and query operators beyond equality/comparison: geometric objects text search IP ranges JSON paths custom types - by allowing user-defined key types and split/union/penalty functions एक एक्स्टेंसिबल इंडेक्स फ्रेमवर्क जो समानता/तुलना से परे विभिन्न प्रकार के डेटा प्रकारों और क्वेरी ऑपरेटरों का समर्थन करता है: ज्यामितीय ऑब्जेक्ट टेक्स्ट खोज आईपी रेंज JSON पथ कस्टम प्रकार - उपयोगकर्ता-परिभाषित कुंजी प्रकारों और विभाजन/संघ/दंड कार्यों की अनुमति देकर
C
A special type of B-tree for integers only केवल पूर्णांकों के लिए एक विशेष प्रकार का बी-ट्री
D
A global index that spans multiple tables simultaneously एक वैश्विक सूचकांक जो एक साथ कई तालिकाओं को फैलाता है
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) GiST (Generalized Search Tree): framework for building balanced tree indexes on any data type. PostgreSQL uses GiST for: 2D geometric types (&&, @>, intersects), full-text search (tsvector), IP ranges (inet, cidr), interval overlaps. User can define custom GiST index types by implementing key functions.
व्याख्या (हिन्दी) GiST (सामान्यीकृत खोज ट्री): किसी भी डेटा प्रकार पर संतुलित ट्री इंडेक्स बनाने के लिए रूपरेखा। PostgreSQL इसके लिए GiST का उपयोग करता है: 2D ज्यामितीय प्रकार (&&, @>, प्रतिच्छेद), पूर्ण-पाठ खोज (tsvector), IP श्रेणियाँ (inet, cidr), अंतराल ओवरलैप। उपयोगकर्ता प्रमुख कार्यों को लागू करके कस्टम जीआईएसटी सूचकांक प्रकारों को परिभाषित कर सकता है।
95
EN + हिं Easy
GB What is an index hint and when should it be used?
IN इंडेक्स संकेत क्या है और इसका उपयोग कब किया जाना चाहिए?
A
A directive added to a SQL query that forces or suggests the query optimizer to use a specific index instead of choosing one automatically - should be used sparingly when the optimizer consistently makes poor choices due to inaccurate statistics or atypical query patterns SQL क्वेरी में जोड़ा गया एक निर्देश जो क्वेरी ऑप्टिमाइज़र को किसी एक को स्वचालित रूप से चुनने के बजाय एक विशिष्ट इंडेक्स का उपयोग करने के लिए मजबूर करता है या सुझाव देता है - जब ऑप्टिमाइज़र लगातार गलत आंकड़ों या असामान्य क्वेरी पैटर्न के कारण खराब विकल्प बनाता है तो इसका उपयोग कम से कम किया जाना चाहिए।
B
A comment in SQL code suggesting an index SQL कोड में एक टिप्पणी जो एक इंडेक्स का सुझाव देती है
C
An index optimization applied at compile time संकलन समय पर एक सूचकांक अनुकूलन लागू किया गया
D
An automatic suggestion from the DBMS to add new indexes नए इंडेक्स जोड़ने के लिए डीबीएमएस से एक स्वचालित सुझाव
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Index hint: MySQL: SELECT * FROM t USE INDEX (idx_name) WHERE ...; SQL Server: SELECT * FROM t WITH (INDEX(idx_name)) WHERE ...; Oracle: SELECT /*+ INDEX(t idx_name) */ * FROM t WHERE ... Overrides optimizer choice. Use when: optimizer systematically picks wrong index due to bad statistics, very specific workloads with known access patterns. Avoid: hard-coding hints creates maintenance burden.
व्याख्या (हिन्दी) सूचकांक संकेत: MySQL: चयन करें * सूचकांक का उपयोग करने से (idx_name) जहां...; एसक्यूएल सर्वर: चयन करें * टी के साथ (INDEX(idx_name)) कहां...; ओरेकल: SELECT /*+ INDEX(t idx_name) */ * FROM t WHERE... ऑप्टिमाइज़र विकल्प को ओवरराइड करता है। जब उपयोग करें: ऑप्टिमाइज़र खराब आँकड़ों, ज्ञात पहुँच पैटर्न के साथ बहुत विशिष्ट कार्यभार के कारण व्यवस्थित रूप से गलत सूचकांक चुनता है। बचें: हार्ड-कोडिंग संकेत रखरखाव का बोझ पैदा करते हैं।
96
EN + हिं Medium
GB What is the adaptive hash index (AHI) in MySQL InnoDB and how does it work?
IN MySQL InnoDB में एडाप्टिव हैश इंडेक्स (AHI) क्या है और यह कैसे काम करता है?
A
A manually configured hash index मैन्युअल रूप से कॉन्फ़िगर किया गया हैश इंडेक्स
B
An automatically built in-memory hash index that InnoDB creates on top of frequently accessed B-tree index pages - when InnoDB detects that the same index lookups are performed repeatedly it builds a hash index for those values enabling O(1) lookup vs O(log n) B-tree traversal एक स्वचालित रूप से निर्मित इन-मेमोरी हैश इंडेक्स जिसे InnoDB अक्सर एक्सेस किए गए B-ट्री इंडेक्स पेजों के शीर्ष पर बनाता है - जब InnoDB पता लगाता है कि एक ही इंडेक्स लुकअप बार-बार किया जाता है तो यह उन मानों के लिए एक हैश इंडेक्स बनाता है जो O(1) लुकअप बनाम O(लॉग एन) B-ट्री ट्रैवर्सल को सक्षम करता है।
C
A hash index that adapts to changing data distributions एक हैश इंडेक्स जो बदलते डेटा वितरण के अनुकूल होता है
D
A persistent hash index stored on disk डिस्क पर संग्रहीत एक सतत हैश इंडेक्स
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Adaptive Hash Index: InnoDB monitors index access patterns. If it detects frequent repeated lookups of specific key values on a B-tree index, it automatically builds an in-memory hash table for those values. Lookup becomes O(1) instead of O(log n). Can be disabled (innodb_adaptive_hash_index=OFF) if contention on the AHI latch becomes a bottleneck.
व्याख्या (हिन्दी) अनुकूली हैश इंडेक्स: InnoDB इंडेक्स एक्सेस पैटर्न की निगरानी करता है। यदि यह बी-ट्री इंडेक्स पर विशिष्ट कुंजी मानों के बार-बार दोहराए जाने वाले लुकअप का पता लगाता है, तो यह स्वचालित रूप से उन मानों के लिए इन-मेमोरी हैश तालिका बनाता है। लुकअप O(लॉग एन) के बजाय O(1) हो जाता है। यदि AHI लैच पर विवाद एक बाधा बन जाता है तो इसे अक्षम किया जा सकता है (innodb_adaptive_hash_index=OFF)।
97
EN + हिं Hard
GB What is index compression and how does it reduce storage and improve performance?
IN इंडेक्स कम्प्रेशन क्या है और यह स्टोरेज को कैसे कम करता है और प्रदर्शन में सुधार करता है?
A
Using fewer indexes to reduce storage भंडारण कम करने के लिए कम अनुक्रमणिका का उपयोग करना
B
A technique that reduces the storage size of index entries by: prefix compression (storing only the suffix that differs from the previous key for sorted keys) dictionary compression (replacing repeated values with integer codes) or key compression - smaller index means more pages fit in buffer pool improving cache efficiency and reducing I/O एक तकनीक जो सूचकांक प्रविष्टियों के भंडारण आकार को कम कर देती है: उपसर्ग संपीड़न (केवल प्रत्यय को संग्रहीत करना जो सॉर्ट की गई कुंजी के लिए पिछली कुंजी से भिन्न होता है) शब्दकोश संपीड़न (पूर्णांक कोड के साथ दोहराए गए मानों को बदलना) या कुंजी संपीड़न - छोटे सूचकांक का मतलब है कि बफर पूल में अधिक पृष्ठ फिट होते हैं, कैश दक्षता में सुधार होता है और I/O कम होता है
C
Compressing the entire table to save space स्थान बचाने के लिए संपूर्ण तालिका को संपीड़ित करना
D
Removing duplicate rows from the indexed table अनुक्रमित तालिका से डुप्लिकेट पंक्तियाँ हटाना
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Index compression techniques: (1) Prefix compression (key prefix elision): sorted B-tree keys share common prefixes - store full prefix once, then only the unique suffix for each key. (2) Dictionary encoding: replace repeated values with small integer codes. Benefits: index pages hold more entries (better fan-out), more pages fit in buffer pool (fewer I/O). Used in columnar indexes and InnoDB page compression.
व्याख्या (हिन्दी) सूचकांक संपीड़न तकनीक: (1) उपसर्ग संपीड़न (कुंजी उपसर्ग एलिसन): क्रमबद्ध बी-ट्री कुंजियाँ सामान्य उपसर्ग साझा करती हैं - पूर्ण उपसर्ग को एक बार संग्रहीत करें, फिर प्रत्येक कुंजी के लिए केवल अद्वितीय प्रत्यय। (2) शब्दकोश एन्कोडिंग: दोहराए गए मानों को छोटे पूर्णांक कोड से बदलें। लाभ: सूचकांक पृष्ठों में अधिक प्रविष्टियाँ होती हैं (बेहतर फैन-आउट), अधिक पृष्ठ बफर पूल में फिट होते हैं (कम I/O)। स्तंभ अनुक्रमणिका और InnoDB पृष्ठ संपीड़न में उपयोग किया जाता है।
98
EN + हिं Medium
GB What is the difference between a primary index and a secondary index?
IN प्राथमिक सूचकांक और द्वितीयक सूचकांक के बीच क्या अंतर है?
A
Secondary indexes are always slower than primary indexes द्वितीयक सूचकांक हमेशा प्राथमिक सूचकांक की तुलना में धीमे होते हैं
B
A primary index is built on the primary key and determines the physical order of data (clustered); secondary indexes are built on non-primary key columns and do not determine physical data order (non-clustered in most DBMS) - secondary indexes reference the primary key to locate actual rows एक प्राथमिक सूचकांक प्राथमिक कुंजी पर बनाया गया है और डेटा (क्लस्टर) का भौतिक क्रम निर्धारित करता है; द्वितीयक सूचकांक गैर-प्राथमिक कुंजी स्तंभों पर बनाए जाते हैं और भौतिक डेटा क्रम निर्धारित नहीं करते हैं (अधिकांश डीबीएमएस में गैर-क्लस्टर) - द्वितीयक सूचकांक वास्तविक पंक्तियों का पता लगाने के लिए प्राथमिक कुंजी का संदर्भ देते हैं
C
Primary indexes can only be on single columns प्राथमिक सूचकांक केवल एकल कॉलम पर हो सकते हैं
D
They are identical in structure वे संरचना में समान हैं
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Primary index (clustered/primary key index): defines physical data order, one per table, uniquely identifies rows. Secondary index: built on any other column(s), does not determine physical storage, points to primary key (or ROWID/heap pointer). MySQL InnoDB: secondary indexes contain primary key values as row locators (not heap pointers), enabling efficient PK lookup after secondary index scan.
व्याख्या (हिन्दी) प्राथमिक सूचकांक (संकुल/प्राथमिक कुंजी सूचकांक): भौतिक डेटा क्रम को परिभाषित करता है, प्रति तालिका एक, विशिष्ट रूप से पंक्तियों की पहचान करता है। द्वितीयक सूचकांक: किसी अन्य कॉलम पर निर्मित, भौतिक भंडारण निर्धारित नहीं करता है, प्राथमिक कुंजी (या ROWID/हीप पॉइंटर) को इंगित करता है। MySQL InnoDB: सेकेंडरी इंडेक्स में पंक्ति लोकेटर (हीप पॉइंटर्स नहीं) के रूप में प्राथमिक कुंजी मान होते हैं, जो सेकेंडरी इंडेक्स स्कैन के बाद कुशल PK लुकअप को सक्षम करता है।
99
EN + हिं Easy
GB What is the column store index (columnstore index) in SQL Server and what is its primary use case?
IN SQL सर्वर में कॉलम स्टोर इंडेक्स (कॉलमस्टोर इंडेक्स) क्या है और इसका प्राथमिक उपयोग मामला क्या है?
A
A special index type that stores data by column rather than by row enabling high compression and vectorized batch processing - primarily used for OLAP/analytical workloads where queries aggregate over large datasets and touch only a few columns एक विशेष सूचकांक प्रकार जो उच्च संपीड़न और वेक्टरकृत बैच प्रोसेसिंग को सक्षम करने के लिए पंक्ति के बजाय कॉलम द्वारा डेटा संग्रहीत करता है - मुख्य रूप से ओएलएपी/विश्लेषणात्मक वर्कलोड के लिए उपयोग किया जाता है जहां क्वेरी बड़े डेटासेट पर एकत्र होती हैं और केवल कुछ कॉलम को छूती हैं
B
An index that references columns in other tables एक सूचकांक जो अन्य तालिकाओं में स्तंभों का संदर्भ देता है
C
An index that sorts columns alphabetically एक सूचकांक जो स्तंभों को वर्णानुक्रम में क्रमबद्ध करता है
D
An index that compresses column names एक सूचकांक जो स्तंभ नामों को संपीड़ित करता है
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) SQL Server columnstore index: stores each column separately using compression (RLE, dictionary). Queries that aggregate only a few columns of a large table read only those columns. Batch mode processing: processes 64-900 rows at a time using SIMD/vectorized operations. 10-100x faster for analytics. Can be combined with rowstore for HTAP workloads (clustered columnstore + nonclustered rowstore).
व्याख्या (हिन्दी) SQL सर्वर कॉलमस्टोर इंडेक्स: संपीड़न (आरएलई, डिक्शनरी) का उपयोग करके प्रत्येक कॉलम को अलग से संग्रहीत करता है। वे क्वेरीज़ जो किसी बड़ी तालिका के केवल कुछ स्तंभों को एकत्रित करती हैं, केवल उन्हीं स्तंभों को पढ़ती हैं। बैच मोड प्रसंस्करण: SIMD/वेक्टरीकृत संचालन का उपयोग करके एक समय में 64-900 पंक्तियों को संसाधित करता है। एनालिटिक्स के लिए 10-100 गुना तेज। HTAP वर्कलोड (क्लस्टर्ड कॉलमस्टोर + नॉनक्लस्टर्ड रोस्टोर) के लिए रोस्टोर के साथ जोड़ा जा सकता है।
100
EN + हिं Easy
GB What is index maintenance overhead and how should DBAs manage it in production systems?
IN सूचकांक रखरखाव ओवरहेड क्या है और डीबीए को इसे उत्पादन प्रणालियों में कैसे प्रबंधित करना चाहिए?
A
The cost of creating new indexes नए सूचकांक बनाने की लागत
B
The cost of reading from indexes अनुक्रमणिका से पढ़ने की लागत
C
The cost of updating indexes on every INSERT/UPDATE/DELETE which includes: additional I/O for each index page write, page splits causing fragmentation, and potential index bloat - managed by: choosing indexes carefully (only create indexes that pay off) rebuilding fragmented indexes (ALTER INDEX REBUILD) and reorganizing (ALTER INDEX REORGANIZE) on a scheduled basis प्रत्येक INSERT/UPDATE/DELETE पर इंडेक्स को अपडेट करने की लागत जिसमें शामिल है: प्रत्येक इंडेक्स पेज लिखने के लिए अतिरिक्त I/O, पृष्ठ विभाजन के कारण विखंडन, और संभावित इंडेक्स ब्लोट - द्वारा प्रबंधित: इंडेक्स को सावधानीपूर्वक चुनना (केवल ऐसे इंडेक्स बनाएं जो भुगतान करते हैं) खंडित इंडेक्स का पुनर्निर्माण (ALTER INDEX REBUILD) और एक निर्धारित आधार पर पुनर्गठित करना (ALTER INDEX REORGANIZE)
D
Indexes that require manual maintenance ऐसे सूचकांक जिन्हें मैन्युअल रखरखाव की आवश्यकता होती है
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Index maintenance overhead: every write to a table incurs write amplification for each index. Management strategies: (1) Monitor index usage (sys.dm_db_index_usage_stats in SQL Server) - drop unused indexes. (2) Monitor fragmentation - rebuild (fast but locks) or reorganize (online, slower) based on fragmentation level. (3) Schedule maintenance during off-peak hours. (4) Use fill factor to delay page splits.
व्याख्या (हिन्दी) सूचकांक रखरखाव ओवरहेड: तालिका में प्रत्येक लेखन प्रत्येक सूचकांक के लिए लेखन प्रवर्धन को लागू करता है। प्रबंधन रणनीतियाँ: (1) इंडेक्स उपयोग की निगरानी करें (SQL सर्वर में sys.dm_db_index_usage_stats) - अप्रयुक्त इंडेक्स को हटा दें। (2) विखंडन की निगरानी करें - विखंडन स्तर के आधार पर पुनर्निर्माण (तेज़ लेकिन लॉक) या पुनर्गठित (ऑनलाइन, धीमा)। (3) ऑफ-पीक घंटों के दौरान रखरखाव शेड्यूल करें। (4) पृष्ठ विभाजन में देरी के लिए भरण कारक का उपयोग करें।
101
EN + हिं Easy
GB What is index selectivity estimation and why do stale statistics cause poor query plans?
IN सूचकांक चयनात्मकता अनुमान क्या है और पुराने आँकड़े खराब क्वेरी योजनाओं का कारण क्यों बनते हैं?
A
Estimating how many indexes a table needs for optimal performance यह अनुमान लगाना कि इष्टतम प्रदर्शन के लिए किसी तालिका को कितने अनुक्रमितों की आवश्यकता है
B
A method for compressing index storage to reduce disk space usage डिस्क स्थान के उपयोग को कम करने के लिए इंडेक्स स्टोरेज को संपीड़ित करने की एक विधि
C
The query optimizer estimates how many rows an index access will return using column statistics (histogram, distinct value count, null fraction); stale statistics cause the optimizer to generate suboptimal plans such as choosing a full table scan when a highly selective index exists or choosing an index scan when most rows match and a full scan would be faster क्वेरी ऑप्टिमाइज़र अनुमान लगाता है कि कॉलम आँकड़ों (हिस्टोग्राम, विशिष्ट मान गणना, शून्य अंश) का उपयोग करके इंडेक्स एक्सेस कितनी पंक्तियाँ लौटाएगा; पुराने आँकड़े ऑप्टिमाइज़र को उप-इष्टतम योजनाएँ उत्पन्न करने का कारण बनते हैं जैसे कि अत्यधिक चयनात्मक सूचकांक मौजूद होने पर पूर्ण तालिका स्कैन चुनना या जब अधिकांश पंक्तियाँ मेल खाती हैं तो सूचकांक स्कैन चुनना और पूर्ण स्कैन तेज़ होगा
D
Counting the number of distinct index values for reporting purposes रिपोर्टिंग उद्देश्यों के लिए विशिष्ट सूचकांक मानों की संख्या की गणना करना
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Statistics staleness: after bulk INSERT/DELETE/UPDATE of large percentage of table, statistics become stale. Fix: ANALYZE table (PostgreSQL), UPDATE STATISTICS table (SQL Server), ANALYZE TABLE table (MySQL). Auto-stats: autovacuum in PostgreSQL updates stats when >20% of table changes. Bad plan symptoms: EXPLAIN shows Rows=1 but actual=1000000 (huge estimate error).
व्याख्या (हिन्दी) सांख्यिकी बासीपन: तालिका के बड़े प्रतिशत को सम्मिलित करने/हटाने/अद्यतन करने के बाद, आँकड़े बासी हो जाते हैं। ठीक करें: तालिका का विश्लेषण करें (PostgreSQL), अद्यतन सांख्यिकी तालिका (SQL सर्वर), तालिका तालिका का विश्लेषण करें (MySQL)। ऑटो-आँकड़े: PostgreSQL में ऑटोवैक्यूम आँकड़े अपडेट करता है जब तालिका का 20% बदलता है। ख़राब योजना के लक्षण: EXPLAIN पंक्तियाँ=1 दिखाता है लेकिन वास्तविक=1000000 (भारी अनुमान त्रुटि)।
102
EN + हिं Medium
GB What is the difference between index range scan and full index scan in execution plans?
IN निष्पादन योजनाओं में इंडेक्स रेंज स्कैन और पूर्ण इंडेक्स स्कैन के बीच क्या अंतर है?
A
Full index scan is always faster than range scan in all scenarios पूर्ण सूचकांक स्कैन सभी परिदृश्यों में रेंज स्कैन से हमेशा तेज़ होता है
B
Range scan always reads more data than full index scan रेंज स्कैन हमेशा पूर्ण इंडेक्स स्कैन की तुलना में अधिक डेटा पढ़ता है
C
Index range scan: uses the B-tree to navigate to the start of a range and reads sequentially until the range end; efficient for selective range conditions. Full index scan: reads all leaf pages of the index from start to end; used when ORDER BY matches index, covering index answers query without heap access, or for small tables इंडेक्स रेंज स्कैन: किसी रेंज की शुरुआत में नेविगेट करने के लिए बी-ट्री का उपयोग करता है और रेंज के अंत तक क्रमिक रूप से पढ़ता है; चयनात्मक श्रेणी स्थितियों के लिए कुशल। पूर्ण इंडेक्स स्कैन: इंडेक्स के सभी लीफ पेजों को शुरू से अंत तक पढ़ता है; इसका उपयोग तब किया जाता है जब ORDER BY इंडेक्स से मेल खाता है, इंडेक्स उत्तर क्वेरी को बिना हीप एक्सेस के, या छोटी तालिकाओं के लिए कवर करता है
D
They are identical operations with different names in different databases वे अलग-अलग डेटाबेस में अलग-अलग नामों के साथ समान ऑपरेशन हैं
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) PostgreSQL EXPLAIN: Index Scan (range seek) vs Index Only Scan (covering, full or range) vs Seq Scan (heap). When does optimizer prefer full index scan over full heap scan? When index is much smaller than table AND all needed columns are in the index (index-only scan). When does it prefer full heap scan over full index scan? When index is nearly as large as heap and most rows are selected. Threshold: typically >10-20% of rows -> full scan preferred.
व्याख्या (हिन्दी) PostgreSQL व्याख्या: इंडेक्स स्कैन (रेंज सीक) बनाम इंडेक्स ओनली स्कैन (कवरिंग, फुल या रेंज) बनाम सेक स्कैन (हीप)। ऑप्टिमाइज़र कब पूर्ण हीप स्कैन की तुलना में पूर्ण इंडेक्स स्कैन को प्राथमिकता देता है? जब सूचकांक तालिका से बहुत छोटा होता है और सभी आवश्यक कॉलम सूचकांक में होते हैं (केवल सूचकांक स्कैन)। यह पूर्ण इंडेक्स स्कैन की तुलना में पूर्ण हीप स्कैन को कब प्राथमिकता देता है? जब सूचकांक लगभग ढेर जितना बड़ा हो और अधिकांश पंक्तियाँ चयनित हों। सीमा: आम तौर पर >10-20% पंक्तियाँ -> पूर्ण स्कैन को प्राथमिकता दी जाती है।
103
EN + हिं Medium
GB What is a covering index and how does it eliminate the need for a table lookup?
IN कवरिंग इंडेक्स क्या है और यह टेबल लुकअप की आवश्यकता को कैसे समाप्त करता है?
A
An index that covers the entire table physically एक सूचकांक जो संपूर्ण तालिका को भौतिक रूप से कवर करता है
B
An index that automatically covers all queries एक सूचकांक जो स्वचालित रूप से सभी प्रश्नों को कवर करता है
C
An index that contains all the columns needed to satisfy a query - when the query engine can find all required data directly in the index leaves without accessing the base table (heap lookup) dramatically improving query performance एक इंडेक्स जिसमें किसी क्वेरी को संतुष्ट करने के लिए आवश्यक सभी कॉलम शामिल होते हैं - जब क्वेरी इंजन बेस टेबल (हीप लुकअप) तक पहुंच के बिना सीधे इंडेक्स लीव्स में सभी आवश्यक डेटा पा सकता है, तो क्वेरी प्रदर्शन में नाटकीय रूप से सुधार होता है
D
An index that covers all tables in a schema एक सूचकांक जो एक स्कीमा में सभी तालिकाओं को कवर करता है
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Covering index: includes all columns referenced by the query (SELECT, WHERE, ORDER BY, GROUP BY). Query can be answered from the index alone - no additional heap/table lookup. Example: INDEX(dept_id, salary, name) covers SELECT name, AVG(salary) WHERE dept_id=5 GROUP BY dept_id - all columns in index.
व्याख्या (हिन्दी) कवरिंग इंडेक्स: क्वेरी द्वारा संदर्भित सभी कॉलम शामिल हैं (SELECT, WHERE, ORDER BY, GROUP BY)। क्वेरी का उत्तर अकेले सूचकांक से दिया जा सकता है - कोई अतिरिक्त ढेर/टेबल लुकअप नहीं। उदाहरण: INDEX(dept_id, वेतन, नाम) SELECT नाम, AVG(वेतन) को कवर करता है जहां dept_id=5 ग्रुप BY dept_id - इंडेक्स में सभी कॉलम।
104
EN + हिं Easy
GB What is a bitmap index and in what scenarios is it more efficient than a B-tree index?
IN बिटमैप इंडेक्स क्या है और किन परिदृश्यों में यह बी-ट्री इंडेक्स से अधिक कुशल है?
A
A type of hash index using bitmap hashing बिटमैप हैशिंग का उपयोग करते हुए एक प्रकार का हैश इंडेक्स
B
An index stored as binary data बाइनरी डेटा के रूप में संग्रहीत एक सूचकांक
C
A compressed B-tree index using bitmaps बिटमैप्स का उपयोग करके एक संपीड़ित बी-ट्री इंडेक्स
D
An index type where each distinct value has a bit vector (one bit per table row) indicating which rows have that value - highly efficient for low-cardinality columns in read-heavy OLAP environments but expensive to maintain in concurrent write environments एक सूचकांक प्रकार जहां प्रत्येक विशिष्ट मान में एक बिट वेक्टर (प्रति तालिका पंक्ति में एक बिट) होता है जो दर्शाता है कि किन पंक्तियों में वह मान है - पढ़ने-भारी ओएलएपी वातावरण में कम-कार्डिनैलिटी कॉलम के लिए अत्यधिक कुशल लेकिन समवर्ती लेखन वातावरण में बनाए रखना महंगा है
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Bitmap index: for gender column (M/F), two bitmaps: M=1010011..., F=0101100... AND/OR bitmaps for complex filters (dept=Sales AND status=active AND region=East). Extremely fast for OLAP. Bad for OLTP: bitmap locking granularity causes lock contention on concurrent updates.
व्याख्या (हिन्दी) बिटमैप इंडेक्स: लिंग कॉलम (एम/एफ) के लिए, दो बिटमैप: एम=1010011..., एफ=0101100... और/या जटिल फिल्टर के लिए बिटमैप (विभाग=बिक्री और स्थिति=सक्रिय और क्षेत्र=पूर्व)। OLAP के लिए अत्यंत तेज़. ओएलटीपी के लिए खराब: बिटमैप लॉकिंग ग्रैन्युलैरिटी समवर्ती अपडेट पर लॉक विवाद का कारण बनती है।
105
EN + हिं Medium
GB What is index selectivity and how does it determine whether an index will be used by the query optimizer?
IN सूचकांक चयनात्मकता क्या है और यह कैसे निर्धारित करती है कि क्वेरी अनुकूलक द्वारा सूचकांक का उपयोग किया जाएगा या नहीं?
A
The percentage of rows that match a given query किसी दी गई क्वेरी से मेल खाने वाली पंक्तियों का प्रतिशत
B
The number of levels in a B-tree index बी-ट्री इंडेक्स में स्तरों की संख्या
C
The speed at which an index returns results वह गति जिस पर कोई सूचकांक परिणाम देता है
D
The ratio of distinct values to total rows (cardinality/total_rows); high selectivity (close to 1 like unique ID) means the index filters effectively; low selectivity (close to 0 like boolean) makes the index inefficient - optimizer may choose full scan over low-selectivity index access कुल पंक्तियों के लिए विशिष्ट मानों का अनुपात (कार्डिनैलिटी/कुल_पंक्तियाँ); उच्च चयनात्मकता (अद्वितीय आईडी की तरह 1 के करीब) का मतलब है कि सूचकांक प्रभावी ढंग से फ़िल्टर होता है; कम चयनात्मकता (बूलियन की तरह 0 के करीब) सूचकांक को अक्षम बनाता है - ऑप्टिमाइज़र कम-चयनात्मकता सूचकांक पहुंच पर पूर्ण स्कैन चुन सकता है
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Selectivity = distinct_values / total_rows. High selectivity (0.9-1.0): index very useful, few rows per key value (like customer_id). Low selectivity (0.001): like is_active (True/False) - index returns 50% of rows, full scan may be faster. Optimizer uses selectivity estimates to decide index usage.
व्याख्या (हिन्दी) चयनात्मकता = विशिष्ट_मूल्य/कुल_पंक्तियाँ। उच्च चयनात्मकता (0.9-1.0): सूचकांक बहुत उपयोगी, प्रति कुंजी मान पर कुछ पंक्तियाँ (जैसे customer_id)। कम चयनात्मकता (0.001): जैसे is_active (सही/गलत) - सूचकांक 50% पंक्तियों को लौटाता है, पूर्ण स्कैन तेज हो सकता है। ऑप्टिमाइज़र सूचकांक उपयोग तय करने के लिए चयनात्मकता अनुमान का उपयोग करता है।
91–105 of 136