2191
GB
What is a partial index (also called filtered index) and when is it beneficial?
IN
आंशिक सूचकांक (जिसे फ़िल्टर्ड इंडेक्स भी कहा जाता है) क्या है और यह कब फायदेमंद है?
A
An index that only indexes part of the data physically
एक सूचकांक जो डेटा के केवल भाग को भौतिक रूप से अनुक्रमित करता है
B
An index built incrementally over time
समय के साथ क्रमिक रूप से निर्मित सूचकांक
C
An index that includes only rows satisfying a specified condition (WHERE clause) creating a smaller more efficient index for queries with that condition - e.g. CREATE INDEX ON orders(customer_id) WHERE status=pending
एक सूचकांक जिसमें केवल एक निर्दिष्ट शर्त (WHERE क्लॉज) को संतुष्ट करने वाली पंक्तियाँ शामिल होती हैं, जो उस शर्त के साथ प्रश्नों के लिए एक छोटा और अधिक कुशल सूचकांक बनाती हैं - उदाहरण के लिए ऑर्डर पर इंडेक्स बनाएं (ग्राहक_आईडी) जहां स्थिति = लंबित है
D
An index on a subset of columns
स्तंभों के उपसमूह पर एक सूचकांक
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English)
Partial/filtered index: CREATE INDEX idx_active_users ON users(email) WHERE is_deleted=false. Only indexes non-deleted users (say 95% of queries). Benefits: smaller index (fits better in memory), faster maintenance (only 5% of inserts/updates affect the index), higher effective selectivity.
व्याख्या (हिन्दी)
आंशिक/फ़िल्टर किया गया इंडेक्स: उपयोगकर्ताओं (ईमेल) पर इंडेक्स idx_active_users बनाएं जहां_हटाया गया = गलत है। केवल गैर-हटाए गए उपयोगकर्ताओं को अनुक्रमित करता है (मान लीजिए 95% प्रश्न)। लाभ: छोटा सूचकांक (मेमोरी में बेहतर फिट बैठता है), तेज रखरखाव (केवल 5% इंसर्ट/अपडेट सूचकांक को प्रभावित करते हैं), उच्च प्रभावी चयनात्मकता।