{"id":1455,"date":"2023-11-14T12:42:18","date_gmt":"2023-11-14T12:42:18","guid":{"rendered":"https:\/\/www.devopsfreelancer.com\/blog\/?p=1455"},"modified":"2023-11-14T12:43:02","modified_gmt":"2023-11-14T12:43:02","slug":"list-of-mysql-query-performance-in-laravel","status":"publish","type":"post","link":"https:\/\/www.devopsfreelancer.com\/blog\/list-of-mysql-query-performance-in-laravel\/","title":{"rendered":"List of MySQL Query Performance in Laravel ?"},"content":{"rendered":"\n<p>In this tutorial we&#8217;re going to learn what are the steps for impoving the MySQL Query performance in Laravel.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>1. What is Chunk function ?<\/strong><\/h2>\n\n\n\n<p>The&nbsp;<code>chunk<\/code>&nbsp;method in Laravel is primarily designed to help with memory efficiency rather than directly improving MySQL query performance. It allows you to process large result sets in smaller \u201cchunks\u201d to avoid loading the entire dataset into memory at once. This can be beneficial when dealing with large datasets to prevent memory exhaustion.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"993\" height=\"597\" src=\"https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/11\/image-36.png\" alt=\"\" class=\"wp-image-1456\" srcset=\"https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/11\/image-36.png 993w, https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/11\/image-36-300x180.png 300w, https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/11\/image-36-768x462.png 768w\" sizes=\"auto, (max-width: 993px) 100vw, 993px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Perfomance of using Chunk function ?<\/strong><\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Memory Efficiency:<\/strong>&nbsp;When retrieving a large result set, fetching all records at once can consume a significant amount of memory. By using&nbsp;<code>chunk<\/code>, you process and handle a subset of records at a time, reducing the overall memory footprint.<\/li>\n\n\n\n<li><strong>Avoiding Timeout Issues:<\/strong>&nbsp;For long-running processes, especially in environments with script execution time limits, using&nbsp;<code>chunk<\/code>&nbsp;can help avoid script timeout issues. It ensures that the process is executed in smaller increments, preventing timeouts.<\/li>\n<\/ol>\n\n\n\n<p>While&nbsp;<code>chunk<\/code>&nbsp;itself doesn\u2019t directly optimize the underlying MySQL query, it indirectly contributes to better performance by addressing memory-related challenges. If you\u2019re looking to optimize MySQL queries, you might want to focus on other aspects like proper indexing, query structure, and database design.<\/p>\n\n\n\n<p><strong>Example of Chunk function<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public function get_organisation()\n    {\n         $getting_organisation = &#91;];\n\n        Organisation::latest()-&gt;chunkById(200, function ($organisations) use (&amp;$getting_organisation) {\n            foreach ($organisations as $organisation) {\n                $getting_organisation&#91;] = $organisation;\n            }\n        }, 'id');\n\n        Log::info('coming all organisation in organisation page', &#91;'data_count' =&gt; count($getting_organisation)]);\n        return view('organization-page', compact('getting_organisation'));\n    });<\/code><\/pre>\n\n\n\n<p><strong>Output:-<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"510\" src=\"https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/11\/image-37.png\" alt=\"\" class=\"wp-image-1457\" srcset=\"https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/11\/image-37.png 1024w, https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/11\/image-37-300x150.png 300w, https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/11\/image-37-768x383.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>Now open network and check the response timing.<\/strong><\/p>\n\n\n\n<p><strong>Before of using Chunk function<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"428\" src=\"https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/11\/image-38.png\" alt=\"\" class=\"wp-image-1458\" srcset=\"https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/11\/image-38.png 1024w, https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/11\/image-38-300x125.png 300w, https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/11\/image-38-768x321.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>After using of chunk function its reducing too much timing.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"411\" src=\"https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/11\/image-39.png\" alt=\"\" class=\"wp-image-1459\" srcset=\"https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/11\/image-39.png 1024w, https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/11\/image-39-300x120.png 300w, https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/11\/image-39-768x308.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>2. Use pluck Function <\/strong><\/h2>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>What is Pluck Function ?<\/strong><\/h2>\n\n\n\n<p>The <code class=\"\">pluck()<\/code> method in Laravel is a useful tool for retrieving specific values from a collection of data. It allows you to extract a single key from each item in the collection and return an array of those values. This can be particularly helpful when you only need to work with a subset of the data, or when you want to create a new array based on specific criteria.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"648\" src=\"https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/11\/image-40-1024x648.png\" alt=\"\" class=\"wp-image-1460\" style=\"aspect-ratio:1.5802469135802468;width:956px;height:auto\" srcset=\"https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/11\/image-40-1024x648.png 1024w, https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/11\/image-40-300x190.png 300w, https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/11\/image-40-768x486.png 768w, https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/11\/image-40-1536x972.png 1536w, https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/11\/image-40.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Perfomance of using Pluck function in Laravel ?<\/strong><\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Reduced Data Transfer:<\/strong> <code>pluck<\/code> retrieves only the specified column(s) from the database, reducing the amount of data transferred between the database and your application. This is particularly useful when dealing with large datasets.<\/li>\n\n\n\n<li><strong>Less Memory Usage:<\/strong> Since <code>pluck<\/code> only retrieves a single column from each row, it consumes less memory compared to fetching entire rows of data. This can be beneficial when working with limited memory resources.<\/li>\n\n\n\n<li><strong>Faster Processing:<\/strong> Smaller result sets, obtained through <code>pluck<\/code>, can lead to faster processing times, especially when you don&#8217;t need all the columns of each row. This can improve the overall speed of your application.<\/li>\n\n\n\n<li><strong>Optimized Queries:<\/strong> The generated SQL queries by <code>pluck<\/code> are optimized for fetching specific columns, and they are often more efficient than queries fetching all columns.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Example :- <\/strong><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>public function get_organisation()\n{\n    $org_names = Organisation::latest()-&gt;pluck('org_name');\n\n    Log::info('coming all organisation in organisation page', &#91;'data_count' =&gt; count($org_names)]);\n\n    return view('organization-page', compact('org_names'));\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>3. Better way to retrieve latest rows from a table<\/strong><\/h2>\n\n\n\n<p>To retrieve the latest rows from a table in Laravel, you can use the <code>latest<\/code> method combined with <code>get<\/code> or other query builder methods. Here are a couple of examples:<\/p>\n\n\n\n<p>The <code class=\"\">latest()<\/code> scope provided by Laravel allows you to easily order the results by the specified column in descending order. To retrieve the latest row from a table, you can use the following syntax:<\/p>\n\n\n\n<p><strong>Example :- <\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public function getLatestRecord()\n{\n    $latests = User::latest()-&gt;get();\n\n    dd($latests);\n}<\/code><\/pre>\n\n\n\n<p>Example :- <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Output\n\narray:4 &#91;\n\n  0 =&gt; array:3 &#91;\n\n    \"name\" =&gt; \"keval\"\n\n    \"email\" =&gt; \"keval@gmail.com\"\n\n    \"created_at\" =&gt; \"2019-12-26 00:00:00\"\n\n  ]\n\n  1 =&gt; array:3 &#91;\n\n    \"name\" =&gt; \"piyush\"\n\n    \"email\" =&gt; \"piyush@gmail.com\"\n\n    \"created_at\" =&gt; \"2019-12-25 00:00:00\"\n\n  ]\n\n  2 =&gt; array:3 &#91;\n\n    \"name\" =&gt; \"savan\"\n\n    \"email\" =&gt; \"sava@gmail.com\"\n\n    \"created_at\" =&gt; \"2019-12-09 00:00:00\"\n\n  ]\n\n  3 =&gt; array:3 &#91;\n\n    \"name\" =&gt; \"mehul\"\n\n    \"email\" =&gt; \"mehul@gmail.com\"\n\n    \"created_at\" =&gt; \"2019-12-01 00:00:00\"\n\n  ]\n\n]\n\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>4. Table Indexing<\/strong><\/h2>\n\n\n\n<p>Table indexing in Laravel is an essential aspect of database optimization. Indexing helps speed up query execution by providing a faster way to look up data. Laravel allows you to define indexes using migrations. Indexes are used to quickly retrieve data without having to search every row in a table every time a database table is accessed. Small database wont be noticed but once it grows, the query getting time consuming.<\/p>\n\n\n\n<p id=\"7bf8\">Without index, the process will be from top to bottom of the user data until it the&nbsp;<code>email<\/code>&nbsp;is found. Here is some comparison between with index and without it.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>Without index<\/strong>&nbsp;\u2014 750ms<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>With index<\/strong>&nbsp;\u2014 2ms (400x faster)<\/code><\/pre>\n\n\n\n<p id=\"6101\">In Laravel, the easy way is create a migration file to alter your desire table<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Example :-<\/strong><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code> public function up()\n    {\n        Schema::create('example', function (Blueprint $table) {\n            $table-&gt;id();\n            $table-&gt;string('name')-&gt;unique();\n            $table-&gt;integer('age');\n            $table-&gt;index(&#91;'name', 'age']);\n            $table-&gt;timestamps();\n        });\n    }<\/code><\/pre>\n\n\n\n<p>Now migrate the table<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php artisan migrate<\/code><\/pre>\n\n\n\n<p>By creating this migration, we can speed up our table. Keep in mind, however, this index will only be applied if we search the product using the whole title or the start of the title.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>5. Select only the columns you need<\/strong><\/h2>\n\n\n\n<p>Selecting only the columns you need in Laravel is a good practice for optimizing performance and reducing unnecessary data transfer. You can use the <code>select<\/code> method on the query builder to specify the columns you want to retrieve.<\/p>\n\n\n\n<p>Example :- <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> $getting_value = DB::table('Organisation')-&gt;select('org_name')-&gt;get();<\/code><\/pre>\n\n\n\n<p>Replace <code>'your_table'<\/code> with the actual name of your table and list the columns you need in the <code>select<\/code> method. <\/p>\n\n\n\n<p>This way, only the specified columns will be retrieved from the database, improving performance and reducing the amount of data transferred.<\/p>\n\n\n\n<p>Thanks for learning.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial we&#8217;re going to learn what are the steps for impoving the MySQL Query performance in Laravel. 1. What is Chunk function ? The&nbsp;chunk&nbsp;method in&#8230; <\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[550],"tags":[510,278,88,571,572],"class_list":["post-1455","post","type-post","status-publish","format-standard","hentry","category-mysql","tag-laravel-performance","tag-laravel-query","tag-mysql","tag-mysql-performance","tag-php-mysql"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>List of MySQL Query Performance in Laravel ? - DevOps Freelancer<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.devopsfreelancer.com\/blog\/list-of-mysql-query-performance-in-laravel\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"List of MySQL Query Performance in Laravel ? - DevOps Freelancer\" \/>\n<meta property=\"og:description\" content=\"In this tutorial we&#8217;re going to learn what are the steps for impoving the MySQL Query performance in Laravel. 1. What is Chunk function ? The&nbsp;chunk&nbsp;method in...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.devopsfreelancer.com\/blog\/list-of-mysql-query-performance-in-laravel\/\" \/>\n<meta property=\"og:site_name\" content=\"DevOps Freelancer\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/amitsthakurs\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-11-14T12:42:18+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-11-14T12:43:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/11\/image-36.png\" \/>\n<meta name=\"author\" content=\"Amit Kumar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/amits_thakurs\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Amit Kumar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/list-of-mysql-query-performance-in-laravel\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/list-of-mysql-query-performance-in-laravel\\\/\"},\"author\":{\"name\":\"Amit Kumar\",\"@id\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/#\\\/schema\\\/person\\\/22ed4bd82dc04200a2ca541b3e35fc5b\"},\"headline\":\"List of MySQL Query Performance in Laravel ?\",\"datePublished\":\"2023-11-14T12:42:18+00:00\",\"dateModified\":\"2023-11-14T12:43:02+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/list-of-mysql-query-performance-in-laravel\\\/\"},\"wordCount\":771,\"commentCount\":1,\"image\":{\"@id\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/list-of-mysql-query-performance-in-laravel\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/11\\\/image-36.png\",\"keywords\":[\"laravel-performance\",\"laravel-query\",\"mysql\",\"mysql-performance\",\"php-mysql\"],\"articleSection\":[\"MysQL\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/list-of-mysql-query-performance-in-laravel\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/list-of-mysql-query-performance-in-laravel\\\/\",\"url\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/list-of-mysql-query-performance-in-laravel\\\/\",\"name\":\"List of MySQL Query Performance in Laravel ? - DevOps Freelancer\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/list-of-mysql-query-performance-in-laravel\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/list-of-mysql-query-performance-in-laravel\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/11\\\/image-36.png\",\"datePublished\":\"2023-11-14T12:42:18+00:00\",\"dateModified\":\"2023-11-14T12:43:02+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/#\\\/schema\\\/person\\\/22ed4bd82dc04200a2ca541b3e35fc5b\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/list-of-mysql-query-performance-in-laravel\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/list-of-mysql-query-performance-in-laravel\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/list-of-mysql-query-performance-in-laravel\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/11\\\/image-36.png\",\"contentUrl\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/11\\\/image-36.png\",\"width\":993,\"height\":597},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/list-of-mysql-query-performance-in-laravel\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"List of MySQL Query Performance in Laravel ?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/\",\"name\":\"DevOps Freelancer\",\"description\":\"We provide DevOps | SRE | DevSecOps | MLOps Freelancing\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/#\\\/schema\\\/person\\\/22ed4bd82dc04200a2ca541b3e35fc5b\",\"name\":\"Amit Kumar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d76fb4d0f15f7a458f1fd91063b44fbb7e7eb9e724b1c465d885054c2540250f?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d76fb4d0f15f7a458f1fd91063b44fbb7e7eb9e724b1c465d885054c2540250f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d76fb4d0f15f7a458f1fd91063b44fbb7e7eb9e724b1c465d885054c2540250f?s=96&d=mm&r=g\",\"caption\":\"Amit Kumar\"},\"description\":\"Hi I am Amit Kumar Thakur Experienced as s Software Developer with a demonstrated history of working in the information technology and services industry. Skilled in HTML, CSS, Bootstrap4, PHP, Laravel-9 , REST API,FB API,Google API, Youtube Api, Bitbucket,Github,Linux and jQuery. Strong engineering professional focused in Computer\\\/Information Technology Administration and Management. Currently my profile is to Software Developer, analyze the requirement, creating frame for web application, coding and maintenance.\",\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/amitsthakurs\\\/\",\"https:\\\/\\\/www.instagram.com\\\/amits_thakurs\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/amits-thakurs\\\/\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/amits_thakurs\"],\"url\":\"https:\\\/\\\/www.devopsfreelancer.com\\\/blog\\\/author\\\/amit\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"List of MySQL Query Performance in Laravel ? - DevOps Freelancer","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:\/\/www.devopsfreelancer.com\/blog\/list-of-mysql-query-performance-in-laravel\/","og_locale":"en_US","og_type":"article","og_title":"List of MySQL Query Performance in Laravel ? - DevOps Freelancer","og_description":"In this tutorial we&#8217;re going to learn what are the steps for impoving the MySQL Query performance in Laravel. 1. What is Chunk function ? The&nbsp;chunk&nbsp;method in...","og_url":"https:\/\/www.devopsfreelancer.com\/blog\/list-of-mysql-query-performance-in-laravel\/","og_site_name":"DevOps Freelancer","article_author":"https:\/\/www.facebook.com\/amitsthakurs\/","article_published_time":"2023-11-14T12:42:18+00:00","article_modified_time":"2023-11-14T12:43:02+00:00","og_image":[{"url":"https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/11\/image-36.png","type":"","width":"","height":""}],"author":"Amit Kumar","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/amits_thakurs","twitter_misc":{"Written by":"Amit Kumar","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.devopsfreelancer.com\/blog\/list-of-mysql-query-performance-in-laravel\/#article","isPartOf":{"@id":"https:\/\/www.devopsfreelancer.com\/blog\/list-of-mysql-query-performance-in-laravel\/"},"author":{"name":"Amit Kumar","@id":"https:\/\/www.devopsfreelancer.com\/blog\/#\/schema\/person\/22ed4bd82dc04200a2ca541b3e35fc5b"},"headline":"List of MySQL Query Performance in Laravel ?","datePublished":"2023-11-14T12:42:18+00:00","dateModified":"2023-11-14T12:43:02+00:00","mainEntityOfPage":{"@id":"https:\/\/www.devopsfreelancer.com\/blog\/list-of-mysql-query-performance-in-laravel\/"},"wordCount":771,"commentCount":1,"image":{"@id":"https:\/\/www.devopsfreelancer.com\/blog\/list-of-mysql-query-performance-in-laravel\/#primaryimage"},"thumbnailUrl":"https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/11\/image-36.png","keywords":["laravel-performance","laravel-query","mysql","mysql-performance","php-mysql"],"articleSection":["MysQL"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.devopsfreelancer.com\/blog\/list-of-mysql-query-performance-in-laravel\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.devopsfreelancer.com\/blog\/list-of-mysql-query-performance-in-laravel\/","url":"https:\/\/www.devopsfreelancer.com\/blog\/list-of-mysql-query-performance-in-laravel\/","name":"List of MySQL Query Performance in Laravel ? - DevOps Freelancer","isPartOf":{"@id":"https:\/\/www.devopsfreelancer.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.devopsfreelancer.com\/blog\/list-of-mysql-query-performance-in-laravel\/#primaryimage"},"image":{"@id":"https:\/\/www.devopsfreelancer.com\/blog\/list-of-mysql-query-performance-in-laravel\/#primaryimage"},"thumbnailUrl":"https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/11\/image-36.png","datePublished":"2023-11-14T12:42:18+00:00","dateModified":"2023-11-14T12:43:02+00:00","author":{"@id":"https:\/\/www.devopsfreelancer.com\/blog\/#\/schema\/person\/22ed4bd82dc04200a2ca541b3e35fc5b"},"breadcrumb":{"@id":"https:\/\/www.devopsfreelancer.com\/blog\/list-of-mysql-query-performance-in-laravel\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.devopsfreelancer.com\/blog\/list-of-mysql-query-performance-in-laravel\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.devopsfreelancer.com\/blog\/list-of-mysql-query-performance-in-laravel\/#primaryimage","url":"https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/11\/image-36.png","contentUrl":"https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/11\/image-36.png","width":993,"height":597},{"@type":"BreadcrumbList","@id":"https:\/\/www.devopsfreelancer.com\/blog\/list-of-mysql-query-performance-in-laravel\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.devopsfreelancer.com\/blog\/"},{"@type":"ListItem","position":2,"name":"List of MySQL Query Performance in Laravel ?"}]},{"@type":"WebSite","@id":"https:\/\/www.devopsfreelancer.com\/blog\/#website","url":"https:\/\/www.devopsfreelancer.com\/blog\/","name":"DevOps Freelancer","description":"We provide DevOps | SRE | DevSecOps | MLOps Freelancing","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.devopsfreelancer.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.devopsfreelancer.com\/blog\/#\/schema\/person\/22ed4bd82dc04200a2ca541b3e35fc5b","name":"Amit Kumar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/d76fb4d0f15f7a458f1fd91063b44fbb7e7eb9e724b1c465d885054c2540250f?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/d76fb4d0f15f7a458f1fd91063b44fbb7e7eb9e724b1c465d885054c2540250f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d76fb4d0f15f7a458f1fd91063b44fbb7e7eb9e724b1c465d885054c2540250f?s=96&d=mm&r=g","caption":"Amit Kumar"},"description":"Hi I am Amit Kumar Thakur Experienced as s Software Developer with a demonstrated history of working in the information technology and services industry. Skilled in HTML, CSS, Bootstrap4, PHP, Laravel-9 , REST API,FB API,Google API, Youtube Api, Bitbucket,Github,Linux and jQuery. Strong engineering professional focused in Computer\/Information Technology Administration and Management. Currently my profile is to Software Developer, analyze the requirement, creating frame for web application, coding and maintenance.","sameAs":["https:\/\/www.facebook.com\/amitsthakurs\/","https:\/\/www.instagram.com\/amits_thakurs\/","https:\/\/www.linkedin.com\/in\/amits-thakurs\/","https:\/\/x.com\/https:\/\/twitter.com\/amits_thakurs"],"url":"https:\/\/www.devopsfreelancer.com\/blog\/author\/amit\/"}]}},"_links":{"self":[{"href":"https:\/\/www.devopsfreelancer.com\/blog\/wp-json\/wp\/v2\/posts\/1455","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsfreelancer.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsfreelancer.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsfreelancer.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsfreelancer.com\/blog\/wp-json\/wp\/v2\/comments?post=1455"}],"version-history":[{"count":2,"href":"https:\/\/www.devopsfreelancer.com\/blog\/wp-json\/wp\/v2\/posts\/1455\/revisions"}],"predecessor-version":[{"id":1462,"href":"https:\/\/www.devopsfreelancer.com\/blog\/wp-json\/wp\/v2\/posts\/1455\/revisions\/1462"}],"wp:attachment":[{"href":"https:\/\/www.devopsfreelancer.com\/blog\/wp-json\/wp\/v2\/media?parent=1455"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsfreelancer.com\/blog\/wp-json\/wp\/v2\/categories?post=1455"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsfreelancer.com\/blog\/wp-json\/wp\/v2\/tags?post=1455"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}