{"id":21198,"date":"2024-09-30T04:04:54","date_gmt":"2024-09-30T11:04:54","guid":{"rendered":"https:\/\/www.pingcap.com\/article\/mastering-indexing-in-tidb-for-optimal-query-performance\/"},"modified":"2024-12-11T20:08:28","modified_gmt":"2024-12-12T04:08:28","slug":"mastering-indexing-in-tidb-for-optimal-query-performance","status":"publish","type":"article","link":"https:\/\/www.pingcap.com\/ko\/article\/mastering-indexing-in-tidb-for-optimal-query-performance\/","title":{"rendered":"Mastering Indexing in TiDB for Optimal Query Performance"},"content":{"rendered":"<h2><span class=\"ez-toc-section\" id=\"Understanding_the_Importance_of_Indexing_in_TiDB\"><\/span>Understanding the Importance of Indexing in TiDB<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3>The Role of Indexing in Databases<\/h3>\n<p>Indexing is a fundamental aspect of database management systems, contributing significantly to query performance and data retrieval efficiency. In a sense, indexing acts like a roadmap, allowing the database engine to swiftly locate the requested data without scanning the entire dataset.<\/p>\n<p>Concretely, indexes in databases can be likened to the index in a book. Just as the index of a book makes it easy to locate a specific topic or chapter, a database index enables rapid location of rows within tables based on key column values. This translates to faster data retrieval operations, culminating in accelerated query execution and, consequently, improving the overall user experience.<\/p>\n<p>In the context of <a href=\"https:\/\/tidb.io\/\">\ud2f0DB<\/a>, an open-source NewSQL database that combines the best features of traditional RDBMS and NoSQL systems, indexing not only accelerates query performance but also supports complex transactional and analytical workloads. For comprehensive documentation on best practices in TiDB, please refer to <a href=\"https:\/\/docs.pingcap.com\/tidb\/v7.1\/tidb-best-practices\">TiDB Best Practices<\/a>.<\/p>\n<h3>Key Features of Indexing in TiDB<\/h3>\n<p>TiDB supports several types of indexing mechanisms, each designed to serve specific use cases efficiently. Some of the prominent indexing features include:<\/p>\n<ol>\n<li><strong>Secondary Indexes:<\/strong> TiDB provides full support for secondary indexes, which are particularly useful in optimizing queries that do not solely rely on the primary key. Secondary indexes in TiDB function similarly to those in traditional databases but with added distributed capabilities.<\/li>\n<li><strong>Composite Indexes:<\/strong> TiDB allows the creation of composite indexes, which encompass multiple columns. This feature is invaluable in scenarios where queries involve conditions on multiple columns, thus dramatically reducing the number of rows that need to be scanned.<\/li>\n<li><strong>Covering Indexes:<\/strong> By incorporating all query columns within an index, covering indexes eliminate the need for additional data lookups, reducing I\/O operations and speeding up query performance.<\/li>\n<\/ol>\n<p>For more detailed information on creating and using indexes effectively, visit <a href=\"https:\/\/docs.pingcap.com\/tidb\/v6.1\/dev-guide-index-best-practice\">Best Practices for Indexing<\/a>.<\/p>\n<h3>Common Challenges in Indexing<\/h3>\n<p>While indexing undeniably enhances database performance, it is not devoid of challenges. These challenges, if not addressed, can negate the benefits of indexing and may even deteriorate performance:<\/p>\n<ol>\n<li><strong>Write Overhead:<\/strong> Each insert, update, or delete operation on a table with indexes incurs additional overhead due to the need to maintain these indexes. Consequently, excessive indexing can slow down write operations.<\/li>\n<li><strong>Storage Costs:<\/strong> Indexes consume additional storage space, which, in turn, can elevate storage costs. This is particularly notable for databases with numerous or large indexes.<\/li>\n<li><strong>Maintenance Complexity:<\/strong> Managing and maintaining indexes, particularly in a distributed database like TiDB, can be complex. Indexes must be routinely monitored to ensure their effectiveness and relevance, necessitating a meticulous maintenance strategy.<\/li>\n<\/ol>\n<p>An optimal indexing strategy balances between accelerating query performance and minimizing the imposed overhead. For more insights into optimizing indexing strategies, refer to TiDB&#8217;s documentation on <a href=\"https:\/\/docs.pingcap.com\/tidb\/v6.1\/dev-guide-index-best-practice\">index best practices<\/a>.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Advanced_Indexing_Techniques_in_TiDB\"><\/span>Advanced Indexing Techniques in TiDB<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3>Composite Indexes: Creating and Optimizing<\/h3>\n<p>Composite indexes are crucial when dealing with queries that involve conditions on multiple columns. Creating a composite index in TiDB involves defining a multi-column index in the table schema. Here is an example:<\/p>\n<div class=\"codehilite\">\n<pre><code><span class=\"k\">CREATE<\/span> <span class=\"k\">INDEX<\/span> <span class=\"n\">idx_composite<\/span> <span class=\"k\">ON<\/span> <span class=\"n\">employees<\/span> <span class=\"p\">(<\/span><span class=\"n\">department_id<\/span><span class=\"p\">,<\/span> <span class=\"n\">salary<\/span><span class=\"p\">);<\/span>\n<\/code><\/pre>\n<\/div>\n<p>In this example, a composite index is created on the <code>department_id<\/code> \uadf8\ub9ac\uace0 <code>salary<\/code> columns of the <code>employees<\/code> table. This index proves advantageous for queries such as:<\/p>\n<div class=\"codehilite\">\n<pre><code><span class=\"k\">SELECT<\/span> <span class=\"o\">*<\/span> <span class=\"k\">FROM<\/span> <span class=\"n\">employees<\/span> <span class=\"k\">WHERE<\/span> <span class=\"n\">department_id<\/span> <span class=\"o\">=<\/span> <span class=\"mi\">5<\/span> <span class=\"k\">AND<\/span> <span class=\"n\">salary<\/span> <span class=\"o\">&gt;<\/span> <span class=\"mi\">50000<\/span><span class=\"p\">;<\/span>\n<\/code><\/pre>\n<\/div>\n<p>To optimize composite indexes, it is crucial to adhere to the left-prefix principle, which dictates that queries should filter on the initial columns of the composite index for the index to be effectively utilized. For more practical uses and best practices, refer to <a href=\"https:\/\/docs.pingcap.com\/tidb\/v7.5\/dev-guide-index-best-practice\">Best Practices for Indexing<\/a>.<\/p>\n<h3>Covering Indexes: Reducing I\/O Operations<\/h3>\n<p>Covering indexes encompass all columns needed by the query, thus mitigating the need for additional data retrieval operations. This helps in markedly improving query performance by reducing I\/O operations.<\/p>\n<p>Consider the following example of a covering index:<\/p>\n<div class=\"codehilite\">\n<pre><code><span class=\"k\">CREATE<\/span> <span class=\"k\">INDEX<\/span> <span class=\"n\">idx_covering<\/span> <span class=\"k\">ON<\/span> <span class=\"n\">sales<\/span> <span class=\"p\">(<\/span><span class=\"n\">product_id<\/span><span class=\"p\">,<\/span> <span class=\"n\">order_date<\/span><span class=\"p\">,<\/span> <span class=\"n\">revenue<\/span><span class=\"p\">);<\/span>\n<\/code><\/pre>\n<\/div>\n<p>This index covers queries like:<\/p>\n<div class=\"codehilite\">\n<pre><code><span class=\"k\">SELECT<\/span> <span class=\"n\">product_id<\/span><span class=\"p\">,<\/span> <span class=\"n\">order_date<\/span><span class=\"p\">,<\/span> <span class=\"n\">revenue<\/span> <span class=\"k\">FROM<\/span> <span class=\"n\">sales<\/span> <span class=\"k\">WHERE<\/span> <span class=\"n\">product_id<\/span> <span class=\"o\">=<\/span> <span class=\"mi\">1234<\/span><span class=\"p\">;<\/span>\n<\/code><\/pre>\n<\/div>\n<p>Since all columns required by the query are present in the index, the database can retrieve the data solely from the index, bypassing the need to access the table&#8217;s main storage. This practice drastically reduces query latency and accelerates response times. Learn more about covering indexes and how to implement them effectively from the <a href=\"https:\/\/docs.pingcap.com\/tidb\/v7.5\/dev-guide-index-best-practice\">TiDB documentation<\/a>.<\/p>\n<h3>Full-Text Indexes: Enhancing Search Capabilities<\/h3>\n<p>Full-text indexing is instrumental in enabling efficient text search capabilities, especially in use cases involving vast amounts of textual data. Though not traditionally available in TiDB, workarounds can be employed to simulate full-text search capabilities.<\/p>\n<p>For instance, you can leverage third-party search engines like Elasticsearch in tandem with TiDB. By integrating Elasticsearch, you can index and search text efficiently while still storing structured data in TiDB. Here is a conceptual example:<\/p>\n<div class=\"codehilite\">\n<pre><code><span class=\"c1\"># Python snippet for Elasticsearch with TiDB<\/span>\n<span class=\"kn\">from<\/span> <span class=\"nn\">elasticsearch<\/span> <span class=\"kn\">import<\/span> <span class=\"n\">Elasticsearch<\/span>\n\n<span class=\"n\">es<\/span> <span class=\"o\">=<\/span> <span class=\"n\">Elasticsearch<\/span><span class=\"p\">()<\/span>\n\n<span class=\"c1\"># Index a document<\/span>\n<span class=\"n\">es<\/span><span class=\"o\">.<\/span><span class=\"n\">index<\/span><span class=\"p\">(<\/span><span class=\"n\">index<\/span><span class=\"o\">=<\/span><span class=\"s1\">'documents'<\/span><span class=\"p\">,<\/span> <span class=\"nb\">id<\/span><span class=\"o\">=<\/span><span class=\"mi\">1<\/span><span class=\"p\">,<\/span> <span class=\"n\">body<\/span><span class=\"o\">=<\/span><span class=\"p\">{<\/span>\n    <span class=\"s1\">'title'<\/span><span class=\"p\">:<\/span> <span class=\"s1\">'Introduction to TiDB'<\/span><span class=\"p\">,<\/span>\n    <span class=\"s1\">'content'<\/span><span class=\"p\">:<\/span> <span class=\"s1\">'TiDB is an open-source NewSQL database that supports Hybrid Transactional and Analytical Processing workloads.'<\/span>\n<span class=\"p\">})<\/span>\n\n<span class=\"c1\"># Search the indexed document<\/span>\n<span class=\"n\">results<\/span> <span class=\"o\">=<\/span> <span class=\"n\">es<\/span><span class=\"o\">.<\/span><span class=\"n\">search<\/span><span class=\"p\">(<\/span><span class=\"n\">index<\/span><span class=\"o\">=<\/span><span class=\"s1\">'documents'<\/span><span class=\"p\">,<\/span> <span class=\"n\">body<\/span><span class=\"o\">=<\/span><span class=\"p\">{<\/span>\n  <span class=\"s1\">'query'<\/span><span class=\"p\">:<\/span> <span class=\"p\">{<\/span>\n    <span class=\"s1\">'match'<\/span><span class=\"p\">:<\/span> <span class=\"p\">{<\/span>\n      <span class=\"s1\">'content'<\/span><span class=\"p\">:<\/span> <span class=\"s1\">'NewSQL database'<\/span>\n    <span class=\"p\">}<\/span>\n  <span class=\"p\">}<\/span>\n<span class=\"p\">})<\/span>\n<span class=\"nb\">print<\/span><span class=\"p\">(<\/span><span class=\"n\">results<\/span><span class=\"p\">)<\/span>\n<\/code><\/pre>\n<\/div>\n<p>This Python snippet showcases how to utilize Elasticsearch for text indexing while TiDB manages structured data. For scenarios requiring integrated text search, utilizing add-on solutions like Elasticsearch is recommended.<\/p>\n<h3>Index-Only Scans: Improving Query Efficiency<\/h3>\n<p>Index-only scans occur when the index itself suffices to fulfill the query requirements, thereby obviating the need to access the table rows. This greatly minimizes I\/O operations and enhances query efficiency.<\/p>\n<p>For instance, consider an index created as follows:<\/p>\n<div class=\"codehilite\">\n<pre><code><span class=\"k\">CREATE<\/span> <span class=\"k\">INDEX<\/span> <span class=\"n\">idx_only<\/span> <span class=\"k\">ON<\/span> <span class=\"n\">sales<\/span> <span class=\"p\">(<\/span><span class=\"n\">customer_id<\/span><span class=\"p\">,<\/span> <span class=\"n\">order_total<\/span><span class=\"p\">);<\/span>\n<\/code><\/pre>\n<\/div>\n<p>For queries like:<\/p>\n<div class=\"codehilite\">\n<pre><code><span class=\"k\">SELECT<\/span> <span class=\"n\">customer_id<\/span><span class=\"p\">,<\/span> <span class=\"n\">order_total<\/span> <span class=\"k\">FROM<\/span> <span class=\"n\">sales<\/span> <span class=\"k\">WHERE<\/span> <span class=\"n\">customer_id<\/span> <span class=\"o\">=<\/span> <span class=\"mi\">789<\/span><span class=\"p\">;<\/span>\n<\/code><\/pre>\n<\/div>\n<p>Since all the needed data is contained within the index, TiDB can execute the query solely by scanning the index, greatly improving performance. For further exploration of index-only scans, check out <a href=\"https:\/\/docs.pingcap.com\/tidb\/v6.5\/tidb-best-practices\">TiDB Best Practices<\/a>.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Practical_Applications_and_Case_Studies\"><\/span>Practical Applications and Case Studies<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3>Real-World Examples of Index Optimization in TiDB<\/h3>\n<p>The practical advantages of indexing are best comprehended through real-world applications. Here are a few illustrative examples:<\/p>\n<ol>\n<li><strong>E-commerce Platform:<\/strong> An online retailer leveraged composite and covering indexes to accelerate customer order queries, which significantly reduced page load times during high-traffic shopping seasons.<\/li>\n<li><strong>Financial Institutions:<\/strong> A banking system employed secondary and composite indexes to swiftly process transactional queries, resulting in improved customer service and faster transaction verification.<\/li>\n<\/ol>\n<p>These examples underline how judicious indexing strategies can dramatically enhance system performance and user satisfaction.<\/p>\n<h3>Performance Benchmarks: Indexed vs. Non-indexed Queries<\/h3>\n<p>Benchmarking demonstrates the stark performance improvements brought about by indexing. Consider the following SQL queries on a <code>sales<\/code> table with and without indexes:<\/p>\n<ul>\n<li><strong>Without Index:<\/strong>\n<div class=\"codehilite\">\n<pre><code><span class=\"k\">SELECT<\/span> <span class=\"o\">*<\/span> <span class=\"k\">FROM<\/span> <span class=\"n\">sales<\/span> <span class=\"k\">WHERE<\/span> <span class=\"n\">customer_id<\/span> <span class=\"o\">=<\/span> <span class=\"mi\">3456<\/span><span class=\"p\">;<\/span>\n<\/code><\/pre>\n<\/div>\n<p>Execution Time: 1500ms<\/li>\n<li><strong>With Index:<\/strong>\n<div class=\"codehilite\">\n<pre><code><span class=\"k\">CREATE<\/span> <span class=\"k\">INDEX<\/span> <span class=\"n\">idx_customer<\/span> <span class=\"k\">ON<\/span> <span class=\"n\">sales<\/span> <span class=\"p\">(<\/span><span class=\"n\">customer_id<\/span><span class=\"p\">);<\/span>\n<span class=\"k\">SELECT<\/span> <span class=\"o\">*<\/span> <span class=\"k\">FROM<\/span> <span class=\"n\">sales<\/span> <span class=\"k\">WHERE<\/span> <span class=\"n\">customer_id<\/span> <span class=\"o\">=<\/span> <span class=\"mi\">3456<\/span><span class=\"p\">;<\/span>\n<\/code><\/pre>\n<\/div>\n<p>Execution Time: 100ms<\/li>\n<\/ul>\n<p>The above benchmark results depict a substantial reduction in query execution time when indexes are utilized, vividly showcasing the efficacy of indexing.<\/p>\n<h3>Case Studies: Successful Implementations and Lessons Learned<\/h3>\n<ol>\n<li><strong>Case Study 1: Tech Startup<\/strong>\n<p>A tech startup running a SaaS application optimized query performance by shifting from traditional MySQL to TiDB. They implemented composite and secondary indexes, yielding a 70% reduction in query latency.<\/li>\n<li><strong>Case Study 2: Healthcare Provider<\/strong>\n<p>A healthcare provider managed large-scale patient records. By adopting indexing strategies like clustered indexes and covering indexes, they enhanced data retrieval processes, leading to timely access to patient histories and improving healthcare services.<\/li>\n<\/ol>\n<p>These case studies emphasize the tangible benefits of efficient indexing strategies in real-world scenarios. For deeper insights, explore TiDB&#8217;s comprehensive overview <a href=\"https:\/\/docs.pingcap.com\/tidb\/v5.3\/tidb-best-practices\">\uc5ec\uae30<\/a>.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Indexing is a pivotal element in database management that profoundly impacts query performance and system efficiency. By understanding and deploying advanced indexing techniques such as composite indexes, covering indexes, and index-only scans, you can significantly enhance TiDB&#8217;s performance potential. Real-world applications and case studies further validate the transformative influence of optimized indexing strategies in diverse sectors.<\/p>\n<p>To delve deeper into TiDB&#8217;s indexing practices and leverage its full capabilities, consult the extensive resources available in TiDB&#8217;s documentation:<\/p>\n<ul>\n<li><a href=\"https:\/\/docs.pingcap.com\/tidb\/v7.1\/tidb-best-practices\">TiDB Best Practices<\/a><\/li>\n<li><a href=\"https:\/\/docs.pingcap.com\/tidb\/v6.1\/dev-guide-index-best-practice\">Best Practices for Indexing<\/a>.<\/li>\n<\/ul>\n<p>Harnessing these insights, you can unlock remarkable performance improvements and drive meaningful advancements in your database management initiatives.<\/p>","protected":false},"excerpt":{"rendered":"<p>Learn how effective indexing in TiDB enhances query performance and data retrieval with real-world case studies and advanced techniques.<\/p>","protected":false},"author":8,"featured_media":0,"template":"","class_list":["post-21198","article","type-article","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Mastering Indexing in TiDB for Optimal Query Performance | TiDB<\/title>\n<meta name=\"description\" content=\"Learn how effective indexing in TiDB enhances query performance and data retrieval with real-world case studies and advanced techniques.\" \/>\n<meta name=\"robots\" content=\"noindex, follow\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Mastering Indexing in TiDB for Optimal Query Performance | TiDB\" \/>\n<meta property=\"og:description\" content=\"Learn how effective indexing in TiDB enhances query performance and data retrieval with real-world case studies and advanced techniques.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pingcap.com\/ko\/article\/mastering-indexing-in-tidb-for-optimal-query-performance\/\" \/>\n<meta property=\"og:site_name\" content=\"TiDB\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/facebook.com\/pingcap2015\" \/>\n<meta property=\"article:modified_time\" content=\"2024-12-12T04:08:28+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/static.pingcap.com\/files\/2024\/09\/11005522\/Homepage-Ad.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1440\" \/>\n\t<meta property=\"og:image:height\" content=\"714\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@PingCAP\" \/>\n<meta name=\"twitter:label1\" content=\"\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04\" \/>\n\t<meta name=\"twitter:data1\" content=\"7\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.pingcap.com\/article\/mastering-indexing-in-tidb-for-optimal-query-performance\/\",\"url\":\"https:\/\/www.pingcap.com\/article\/mastering-indexing-in-tidb-for-optimal-query-performance\/\",\"name\":\"Mastering Indexing in TiDB for Optimal Query Performance | TiDB\",\"isPartOf\":{\"@id\":\"https:\/\/www.pingcap.com\/#website\"},\"datePublished\":\"2024-09-30T11:04:54+00:00\",\"dateModified\":\"2024-12-12T04:08:28+00:00\",\"description\":\"Learn how effective indexing in TiDB enhances query performance and data retrieval with real-world case studies and advanced techniques.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.pingcap.com\/article\/mastering-indexing-in-tidb-for-optimal-query-performance\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.pingcap.com\/article\/mastering-indexing-in-tidb-for-optimal-query-performance\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.pingcap.com\/article\/mastering-indexing-in-tidb-for-optimal-query-performance\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.pingcap.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Articles\",\"item\":\"https:\/\/www.pingcap.com\/article\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Mastering Indexing in TiDB for Optimal Query Performance\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.pingcap.com\/#website\",\"url\":\"https:\/\/www.pingcap.com\/\",\"name\":\"TiDB\",\"description\":\"TiDB | SQL at Scale\",\"publisher\":{\"@id\":\"https:\/\/www.pingcap.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.pingcap.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ko-KR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.pingcap.com\/#organization\",\"name\":\"PingCAP\",\"url\":\"https:\/\/www.pingcap.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/www.pingcap.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/static.pingcap.com\/files\/2021\/11\/pingcap-logo.png\",\"contentUrl\":\"https:\/\/static.pingcap.com\/files\/2021\/11\/pingcap-logo.png\",\"width\":811,\"height\":232,\"caption\":\"PingCAP\"},\"image\":{\"@id\":\"https:\/\/www.pingcap.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/facebook.com\/pingcap2015\",\"https:\/\/x.com\/PingCAP\",\"https:\/\/linkedin.com\/company\/pingcap\",\"https:\/\/youtube.com\/channel\/UCuq4puT32DzHKT5rU1IZpIA\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Mastering Indexing in TiDB for Optimal Query Performance | TiDB","description":"Learn how effective indexing in TiDB enhances query performance and data retrieval with real-world case studies and advanced techniques.","robots":{"index":"noindex","follow":"follow"},"og_locale":"ko_KR","og_type":"article","og_title":"Mastering Indexing in TiDB for Optimal Query Performance | TiDB","og_description":"Learn how effective indexing in TiDB enhances query performance and data retrieval with real-world case studies and advanced techniques.","og_url":"https:\/\/www.pingcap.com\/ko\/article\/mastering-indexing-in-tidb-for-optimal-query-performance\/","og_site_name":"TiDB","article_publisher":"https:\/\/facebook.com\/pingcap2015","article_modified_time":"2024-12-12T04:08:28+00:00","og_image":[{"width":1440,"height":714,"url":"https:\/\/static.pingcap.com\/files\/2024\/09\/11005522\/Homepage-Ad.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_site":"@PingCAP","twitter_misc":{"\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04":"7\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.pingcap.com\/article\/mastering-indexing-in-tidb-for-optimal-query-performance\/","url":"https:\/\/www.pingcap.com\/article\/mastering-indexing-in-tidb-for-optimal-query-performance\/","name":"Mastering Indexing in TiDB for Optimal Query Performance | TiDB","isPartOf":{"@id":"https:\/\/www.pingcap.com\/#website"},"datePublished":"2024-09-30T11:04:54+00:00","dateModified":"2024-12-12T04:08:28+00:00","description":"Learn how effective indexing in TiDB enhances query performance and data retrieval with real-world case studies and advanced techniques.","breadcrumb":{"@id":"https:\/\/www.pingcap.com\/article\/mastering-indexing-in-tidb-for-optimal-query-performance\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pingcap.com\/article\/mastering-indexing-in-tidb-for-optimal-query-performance\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.pingcap.com\/article\/mastering-indexing-in-tidb-for-optimal-query-performance\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pingcap.com\/"},{"@type":"ListItem","position":2,"name":"Articles","item":"https:\/\/www.pingcap.com\/article\/"},{"@type":"ListItem","position":3,"name":"Mastering Indexing in TiDB for Optimal Query Performance"}]},{"@type":"WebSite","@id":"https:\/\/www.pingcap.com\/#website","url":"https:\/\/www.pingcap.com\/","name":"\ud2f0DB","description":"TiDB | SQL at Scale","publisher":{"@id":"https:\/\/www.pingcap.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pingcap.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ko-KR"},{"@type":"Organization","@id":"https:\/\/www.pingcap.com\/#organization","name":"PingCAP","url":"https:\/\/www.pingcap.com\/","logo":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.pingcap.com\/#\/schema\/logo\/image\/","url":"https:\/\/static.pingcap.com\/files\/2021\/11\/pingcap-logo.png","contentUrl":"https:\/\/static.pingcap.com\/files\/2021\/11\/pingcap-logo.png","width":811,"height":232,"caption":"PingCAP"},"image":{"@id":"https:\/\/www.pingcap.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/facebook.com\/pingcap2015","https:\/\/x.com\/PingCAP","https:\/\/linkedin.com\/company\/pingcap","https:\/\/youtube.com\/channel\/UCuq4puT32DzHKT5rU1IZpIA"]}]}},"card_markup":"        <a class=\"card-article\" href=\"https:\/\/www.pingcap.com\/ko\/article\/mastering-indexing-in-tidb-for-optimal-query-performance\/\">            <h3>Mastering Indexing in TiDB for Optimal Query Performance<\/h3>            <p>Learn how effective indexing in TiDB enhances query performance and data retrieval with real-world case studies and advanced techniques.<\/p>        <\/a>","_links":{"self":[{"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/article\/21198","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/article"}],"about":[{"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/types\/article"}],"author":[{"embeddable":true,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/users\/8"}],"wp:attachment":[{"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/media?parent=21198"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}