{"id":369393,"date":"2023-02-28T14:15:45","date_gmt":"2023-02-28T14:15:45","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=369393"},"modified":"2023-03-03T05:27:18","modified_gmt":"2023-03-03T05:27:18","slug":"optimizing-sql-queries","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/optimizing-sql-queries\/","title":{"rendered":"Optimizing SQL Queries"},"content":{"rendered":"\n<p>Working as a back-end developer you often needs to work with SQL queries and it is necessary to optimize your queries.<\/p>\n\n\n\n<p>Query Optimization is a process of defining most efficient techniques that can be used to improve query performance. It is necessary to find a way to decrease the response time of query and identify the poor query performance.<\/p>\n\n\n\n<p><em><strong>Reducing response time<\/strong>,<\/em> <strong><em>reducing CPU execution time<\/em><\/strong> and <em><strong>improving throughput<\/strong><\/em> are the major purpose to optimise SQL query. <\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>In this blog we are going to know about few tips to optimise SQL queries.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Below are few tips you should take care in your SQL queries:-<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1. Use<\/strong> <strong><mark style=\"background-color:#a4a1a1;color:#a80000\" class=\"has-inline-color\">SELECT column_name<\/mark><\/strong> <strong>fields instead of<\/strong> <mark style=\"background-color:#a4a1a1;color:#a80000\" class=\"has-inline-color\"><strong>SELECT *<\/strong><\/mark><\/h3>\n\n\n\n<p>Fetch data optimally from SELECT statement instead of selecting all data from table. Fetch only the necessary columns from the table, it helps to avoid the cost of transferring unwanted data and processing it.<\/p>\n\n\n\n<p style=\"font-size:14px\"><strong><strong>Inefficient way:<\/strong><\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">SELECT * FROM employee;<\/pre>\n\n\n\n<p style=\"font-size:14px\"><strong><strong>Optimised way:<\/strong><\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">SELECT first_name, last_name FROM employee;<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2.<\/strong> <strong>Avoid using<\/strong> <mark style=\"background-color:#a4a1a1;color:#a80000\" class=\"has-inline-color\"><strong>SELECT DISTINCT<\/strong><\/mark><\/h3>\n\n\n\n<p>While using SELECT DISTINCT you can remove duplicates from the result, however it requires a lot of  processing power to do this. Instead of using DISTINCT we can fetch more columns to remove duplicates.<\/p>\n\n\n\n<p style=\"font-size:14px\"><strong><strong>Inefficient way:<\/strong><\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">SELECT DISTINCT first_name, last_name FROM employee;<\/pre>\n\n\n\n<p style=\"font-size:14px\"><strong><strong>Optimised way:<\/strong><\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">SELECT first_name, last_name, class, roll_no FROM employee; <\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3. Avoid running SQL queries in loop<\/strong><\/h3>\n\n\n\n<p>SQL queries inside a loop seriously impede performance, especially when server is not on local machine. Wrongly used, these queries unnecessarily consume CPU power, RAM and bandwidth.<\/p>\n\n\n\n<p style=\"font-size:14px\"><strong>Inefficient way:<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">foreach ( $all_users as $user ) {\n    $query = 'INSERT INTO users (first_name,last_name) VALUES (\"' . $user['first_name'] . '\", \"' . $user['last_name'] . '\")';\n}<\/pre>\n\n\n\n<p style=\"font-size:14px\"><strong>Optimised way:<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$user_data = array();\nforeach ( $all_user as $user ) {\n    $user_data[] = '(\"' . $user['first_name'] . '\",  \"'. $user['last_name'] . '\")';\n}\n$query = 'INSERT INTO users (first_name,last_name) VALUES' . implode(',', $user_data);<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>4. Prefer SQL JOINS over Correlated sub-queries<\/strong><\/h3>\n\n\n\n<p>Joins and Sub-queries both are used to fetch data from different tables into a single result, but using  sub-queries where joins should be used will decrease the performance. Sub queries are easy to understand and read to beginners but by the time as an experienced  person Join are the preferrable choice. Even Joins are faster than Sub-queries.<\/p>\n\n\n\n<p style=\"font-size:14px\"><strong>Inefficient way:<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">SELECT first_name, last_name FROM  employee WHERE id IN (SELECT id FROM salary WHERE salary &gt; 5000);<\/pre>\n\n\n\n<p style=\"font-size:14px\"><strong>Optimised way:<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">SELECT e.first_name, e.last_name FROM employee e JOIN salary s ON e.id = s.id WHERE s.salary &gt; 5000;<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>5.  Use <mark style=\"background-color:#a4a1a1;color:#a80000\" class=\"has-inline-color\">EXISTS()<\/mark> rather than <mark style=\"background-color:#a4a1a1;color:#a80000\" class=\"has-inline-color\">COUNT()<\/mark><\/strong><\/h3>\n\n\n\n<p>&nbsp;While checking only for the existence of any matching data values you should use IF EXISTS instead of SELECT COUNT(*), <code>IF EXISTS<\/code>&nbsp;stops the processing of the&nbsp;<code>select<\/code>&nbsp;query as soon as the first matching row is found, whereas&nbsp;<code>SELECT COUNT(*)<\/code>&nbsp;continues searching until all matches are found.<\/p>\n\n\n\n<p style=\"font-size:14px\"><strong>Inefficient way:<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">IF (SELECT COUNT(first_name) FROM employee WHERE emp_id = 875) &gt; 0<\/pre>\n\n\n\n<p style=\"font-size:14px\"><strong>Optimised way:<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">IF EXISTS(SELECT first_name FROM employee WHERE emp_id = 875)<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>6. Use Wildcards wisely<\/strong><\/h3>\n\n\n\n<p>Wildcard characters are used to search the matching pattern in SQL, they can use as prefix or suffix. Using wildcard(%) in combination with an ending wildcard will search all records for a match anywhere within the selected field. For example if we want to fetch all names that start with &#8220;mic&#8221;.<\/p>\n\n\n\n<p style=\"font-size:14px\"><strong>Inefficient way:<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">SELECT first_name FROM employees WHERE first_name LIKE \u2018%mic%\u2019;<\/pre>\n\n\n\n<p>This Will search all employee whose names start with &#8220;mic&#8221; like Michael, Mica, Micayle but it will also fetch results like Jaemica, Hermic and similar.<\/p>\n\n\n\n<p style=\"font-size:14px\"><strong>Optimised way:<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">SELECT first_name FROM employees WHERE first_name LIKE 'mic%';<\/pre>\n\n\n\n<p>This will fetch the desired result, we can use underscore(_) for one character like if we don&#8217;t know the first character but after that &#8220;mic&#8221; should be there.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>So, we had a look why and how SQL query optimisation is necessary. Here are few more points to keep in mind:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use indexing properly, try to create more indexes for fetching composite columns.<\/li>\n\n\n\n<li>Try to use WHERE rather than HAVING. Only use HAVING for aggregated values.<\/li>\n\n\n\n<li>Understanding of columns datatype while comparing them.<\/li>\n\n\n\n<li>Avoid Use of too many JOINS. <\/li>\n<\/ul>\n\n\n\n<p>We looked how minor changes in SQL queries can improve performance of your code drastically. You can use these points in your upcoming projects to increase project using experience.<\/p>\n\n\n\n<p>For more details you can follow MySQL document. <a href=\"https:\/\/dev.mysql.com\/doc\/refman\/8.0\/en\/sql-statements.html\">click here<\/a><\/p>\n\n\n\n<p>Thanks for reading!!!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Working as a back-end developer you often needs to work with SQL queries and it is necessary to optimize your queries. Query Optimization is a process of defining most efficient techniques that can be used to improve query performance. It is necessary to find a way to decrease the response time of query and identify <a href=\"https:\/\/webkul.com\/blog\/optimizing-sql-queries\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":341,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[90,2625,13704,1909,13703],"class_list":["post-369393","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-mysql","tag-optimize","tag-optimizing-sql","tag-select","tag-sql-query"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Optimizing SQL Queries - Webkul Blog %<\/title>\n<meta name=\"description\" content=\"SQL Query optimization is a process of defining most efficient techniques that can be used to improve query performance.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/optimizing-sql-queries\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Optimizing SQL Queries - Webkul Blog %\" \/>\n<meta property=\"og:description\" content=\"SQL Query optimization is a process of defining most efficient techniques that can be used to improve query performance.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/optimizing-sql-queries\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-02-28T14:15:45+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-03-03T05:27:18+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-og.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Yogesh Gangwar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Yogesh Gangwar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/optimizing-sql-queries\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/optimizing-sql-queries\/\"},\"author\":{\"name\":\"Yogesh Gangwar\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/c0826e6d449253246d44d371d519476d\"},\"headline\":\"Optimizing SQL Queries\",\"datePublished\":\"2023-02-28T14:15:45+00:00\",\"dateModified\":\"2023-03-03T05:27:18+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/optimizing-sql-queries\/\"},\"wordCount\":572,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"keywords\":[\"mysql\",\"optimize\",\"optimizing sql\",\"select\",\"SQL query\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/optimizing-sql-queries\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/optimizing-sql-queries\/\",\"url\":\"https:\/\/webkul.com\/blog\/optimizing-sql-queries\/\",\"name\":\"Optimizing SQL Queries - Webkul Blog %\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"datePublished\":\"2023-02-28T14:15:45+00:00\",\"dateModified\":\"2023-03-03T05:27:18+00:00\",\"description\":\"SQL Query optimization is a process of defining most efficient techniques that can be used to improve query performance.\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/optimizing-sql-queries\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/optimizing-sql-queries\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/optimizing-sql-queries\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Optimizing SQL Queries\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/c0826e6d449253246d44d371d519476d\",\"name\":\"Yogesh Gangwar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/23a45e548ee013995a61ba3189ba73859053ac832736d6a69a6c78c925440b0b?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/23a45e548ee013995a61ba3189ba73859053ac832736d6a69a6c78c925440b0b?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Yogesh Gangwar\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/yogeshkumar-gangwar180\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Optimizing SQL Queries - Webkul Blog %","description":"SQL Query optimization is a process of defining most efficient techniques that can be used to improve query performance.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/webkul.com\/blog\/optimizing-sql-queries\/","og_locale":"en_US","og_type":"article","og_title":"Optimizing SQL Queries - Webkul Blog %","og_description":"SQL Query optimization is a process of defining most efficient techniques that can be used to improve query performance.","og_url":"https:\/\/webkul.com\/blog\/optimizing-sql-queries\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2023-02-28T14:15:45+00:00","article_modified_time":"2023-03-03T05:27:18+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-og.png","type":"image\/png"}],"author":"Yogesh Gangwar","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Yogesh Gangwar","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/optimizing-sql-queries\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/optimizing-sql-queries\/"},"author":{"name":"Yogesh Gangwar","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/c0826e6d449253246d44d371d519476d"},"headline":"Optimizing SQL Queries","datePublished":"2023-02-28T14:15:45+00:00","dateModified":"2023-03-03T05:27:18+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/optimizing-sql-queries\/"},"wordCount":572,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"keywords":["mysql","optimize","optimizing sql","select","SQL query"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/optimizing-sql-queries\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/optimizing-sql-queries\/","url":"https:\/\/webkul.com\/blog\/optimizing-sql-queries\/","name":"Optimizing SQL Queries - Webkul Blog %","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"datePublished":"2023-02-28T14:15:45+00:00","dateModified":"2023-03-03T05:27:18+00:00","description":"SQL Query optimization is a process of defining most efficient techniques that can be used to improve query performance.","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/optimizing-sql-queries\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/optimizing-sql-queries\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/optimizing-sql-queries\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Optimizing SQL Queries"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/c0826e6d449253246d44d371d519476d","name":"Yogesh Gangwar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/23a45e548ee013995a61ba3189ba73859053ac832736d6a69a6c78c925440b0b?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/23a45e548ee013995a61ba3189ba73859053ac832736d6a69a6c78c925440b0b?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Yogesh Gangwar"},"url":"https:\/\/webkul.com\/blog\/author\/yogeshkumar-gangwar180\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/369393","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/341"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=369393"}],"version-history":[{"count":27,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/369393\/revisions"}],"predecessor-version":[{"id":371568,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/369393\/revisions\/371568"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=369393"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=369393"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=369393"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}