<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Syed Umer Tariq</title>
    <description>The latest articles on DEV Community by Syed Umer Tariq (@umerfreak).</description>
    <link>https://dev.to/umerfreak</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1029219%2F24373325-8857-44d8-91ce-b569c08f9174.png</url>
      <title>DEV Community: Syed Umer Tariq</title>
      <link>https://dev.to/umerfreak</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/umerfreak"/>
    <language>en</language>
    <item>
      <title>Window Functions In Mariadb (part 2)</title>
      <dc:creator>Syed Umer Tariq</dc:creator>
      <pubDate>Thu, 25 May 2023 08:52:34 +0000</pubDate>
      <link>https://dev.to/umerfreak/window-functions-in-mariadb-part-2-1h6i</link>
      <guid>https://dev.to/umerfreak/window-functions-in-mariadb-part-2-1h6i</guid>
      <description>&lt;h2&gt;
  
  
  AVAILABLE WINDOW FUNCTIONS
&lt;/h2&gt;

&lt;p&gt;MariaDB offers a wide range of built-in window functions to cater to various analytical requirements. These functions include popular ones such as SUM(), AVG(), COUNT(), MIN(), MAX(), and more. Additionally, specialized functions like RANK(), DENSE_RANK(), ROW_NUMBER(), LAG(), and LEAD() enable advanced analytical computations.&lt;/p&gt;

&lt;h2&gt;
  
  
  USE CASES
&lt;/h2&gt;

&lt;p&gt;Window functions find utility in a multitude of scenarios. This section explores some practical use cases where window functions can be applied effectively. Examples include calculating moving averages, generating cumulative sums, identifying top-n records, calculating percentage shares, and detecting trends over time.&lt;/p&gt;

&lt;h2&gt;
  
  
  PERFORMANCE
&lt;/h2&gt;

&lt;p&gt;While window functions provide immense analytical capabilities, it is essential to consider their performance implications. As window functions operate on a set of rows, their execution requires careful optimization to ensure efficient query processing&lt;/p&gt;

&lt;h2&gt;
  
  
  CONCLUSION
&lt;/h2&gt;

&lt;p&gt;Window functions in MariaDB empower users to perform complex analytical computations while maintaining row-level details. With its robustness and performance, MariaDB continues to be an excellent choice for utilizing window functions in relational database environments.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Window Functions In Mariadb (part 1)</title>
      <dc:creator>Syed Umer Tariq</dc:creator>
      <pubDate>Thu, 25 May 2023 08:49:01 +0000</pubDate>
      <link>https://dev.to/umerfreak/window-functions-in-mariadb-part-1-5403</link>
      <guid>https://dev.to/umerfreak/window-functions-in-mariadb-part-1-5403</guid>
      <description>&lt;p&gt;One of the most important features which make dealing with complex computations easy are window functions. The article goes in depth about the window functions in Mariadb (concept, syntax and use cases).&lt;/p&gt;

&lt;p&gt;A window function in MariaDB allows users to perform calculations on a specific set of rows known as a "window." Unlike traditional aggregate functions that collapse rows into a single result, window functions maintain the individual row structure while performing calculations across a defined window frame.&lt;/p&gt;

&lt;h2&gt;
  
  
  SYNTAX OF WINDOW FUNCTIONS
&lt;/h2&gt;

&lt;p&gt;To use window functions in MariaDB, the OVER() clause is employed in conjunction with the desired function. The OVER() clause specifies the window frame and partitioning criteria. The syntax for window functions in MariaDB is as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function_name() OVER (
    [PARTITION BY partition_expression]
    [ORDER BY order_expression [{ASC | DESC}]]
    [frame_clause]
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  PARTITIONING AND ORDER BY IN WINDOW FUNCTIONS
&lt;/h2&gt;

&lt;p&gt;Partitioning allows the data to be divided into distinct groups based on one or more columns. By using the PARTITION BY clause within the window function, users can perform calculations separately for each partition. Ordering, on the other hand, allows rows to be arranged in a specific sequence within each partition. This is accomplished using the ORDER BY clause in conjunction with the window function.&lt;/p&gt;

&lt;h2&gt;
  
  
  FRAME CLAUSES
&lt;/h2&gt;

&lt;p&gt;Frame clauses define the window frame, i.e., the subset of rows used in the calculation. They specify the boundaries of the window in relation to the current row. MariaDB supports three types of frame clauses: ROWS, RANGE, and GROUPS. Each has its own significance and usage scenarios.&lt;/p&gt;

&lt;p&gt;The article is continued in next part which discusses about currently available window functions, their use cases and performance. &lt;a href="https://dev.to/umerfreak/window-functions-in-mariadb-part-2-1h6i"&gt;link_part2&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Dynamic Columns in Mariadb (Part 2)</title>
      <dc:creator>Syed Umer Tariq</dc:creator>
      <pubDate>Mon, 15 May 2023 00:38:10 +0000</pubDate>
      <link>https://dev.to/umerfreak/dynamic-columns-in-mariadb-part-2-307b</link>
      <guid>https://dev.to/umerfreak/dynamic-columns-in-mariadb-part-2-307b</guid>
      <description>&lt;p&gt;In this part we will see why we use dynamic columns in mariadb basically its advantages along with the limitations of using dynamic columns&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Benefits of Dynamic Columns&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Flexibility: Dynamic columns allow for the storage of complex and variable data structures in a single column. This can simplify the database schema and reduce the number of tables and columns required.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Scalability: Dynamic columns can scale to handle large and complex datasets, as they can store a wide range of data structures and formats.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Simplified Data Management: Dynamic columns can simplify data management by allowing for the creation of more flexible and adaptable database schemas. This can reduce the need for complex ETL processes and data transformations&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Limitations of Using Dynamic Columns&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Like every feature dynamic columns also comes up with some trade offs.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Complexity:  Dynamic columns can be more complex to work with than traditional columns, as they require the use of specialized functions and operators to manipulate and retrieve data.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Storage Overhead: Dynamic columns require additional storage overhead to store the binary data associated with the column. This can increase the storage requirements of the database.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Limited Compatibility: Dynamic columns are a feature specific to MariaDB, and may not be compatible with other database systems or tools. This can limit the portability and interoperability of data stored in dynamic columns.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Dynamic columns are very important and useful feature of mariadb which can help create flexible schemas through which variable data structures can be stored in a single columns. They can help in simplifying database design and  reduce the need for complex ETL processes and data transformations. But at the same time it is really important to realize that dynamic columns should be used by first analyzing and understanding what type of data would be stored and using dynamic columns is beneficial or not as it also comes up with trade-offs.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Dynamic Columns in Mariadb (Part 1)</title>
      <dc:creator>Syed Umer Tariq</dc:creator>
      <pubDate>Mon, 15 May 2023 00:18:53 +0000</pubDate>
      <link>https://dev.to/umerfreak/dynamic-columns-in-mariadb-part-1-30mc</link>
      <guid>https://dev.to/umerfreak/dynamic-columns-in-mariadb-part-1-30mc</guid>
      <description>&lt;p&gt;In this article, we will explore the concept of dynamic columns in MariaDB, including how they work, how to create and use them, and their benefits and limitations.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Dynamic Columns&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Dynamic columns are a feature in MariaDB that allow the creation of columns that can store data in a flexible and scalable manner. Unlike traditional columns, which have a fixed data type and length, dynamic columns can store data structures of varying complexity, including arrays, maps, and even entire JSON documents.&lt;/p&gt;

&lt;p&gt;Dynamic columns work by storing the data in a binary format that can be parsed and manipulated by MariaDB using a set of functions and operators. This allows developers to create and store complex data structures in a single column, without the need for multiple columns or tables.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Creation and Use of Dynamic Columns&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Creating a dynamic column in MariaDB is relatively straightforward. To create a dynamic column, you need to specify the column type as &lt;strong&gt;DYNAMIC&lt;/strong&gt; when creating the table. For example, the following SQL statement creates a table with a dynamic column:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CREATE TABLE my_table (
  id INT NOT NULL PRIMARY KEY,
  dynamic_column DYNAMIC
);

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once you have created a table with a dynamic column, you can insert data into the column using the INSERT statement. The data should be in the binary format expected by the dynamic column.&lt;/p&gt;

&lt;p&gt;To retrieve data from a dynamic column, you can use the dynamic column functions and operators provided by MariaDB. These functions and operators allow you to extract and manipulate data stored in the dynamic column, and can be used in SQL queries and stored procedures.&lt;/p&gt;

&lt;p&gt;Here is an example of how to use the dynamic column functions to extract data from a dynamic column:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT id, DYNAMIC_COLUMN_GET(dynamic_column, 'key1') AS value1, DYNAMIC_COLUMN_GET(dynamic_column, 'key2') AS value2
FROM my_table;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This query retrieves the id, value1, and value2 fields from the my_table table. The &lt;strong&gt;DYNAMIC_COLUMN_GET&lt;/strong&gt; function is used to extract the values associated with the &lt;strong&gt;key1&lt;/strong&gt; and &lt;strong&gt;key2&lt;/strong&gt; keys in the dynamic column.&lt;/p&gt;

&lt;p&gt;Benefits and Limits of Dynamic columns are discussed in next part &lt;a href="https://dev.to/umerfreak/dynamic-columns-in-mariadb-part-2-307b"&gt;part-2&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Views In Mariadb (part 2)</title>
      <dc:creator>Syed Umer Tariq</dc:creator>
      <pubDate>Wed, 26 Apr 2023 14:57:17 +0000</pubDate>
      <link>https://dev.to/umerfreak/views-in-mariadb-part-2-36k4</link>
      <guid>https://dev.to/umerfreak/views-in-mariadb-part-2-36k4</guid>
      <description>&lt;h4&gt;
  
  
  Creating and using views in mariadb
&lt;/h4&gt;

&lt;p&gt;Views can be created in a following simple manner in mariadb using &lt;strong&gt;CREATE VIEW&lt;/strong&gt; keyword followed by &lt;strong&gt;SELECT&lt;/strong&gt; statement as done below&lt;/p&gt;

&lt;p&gt;&lt;code&gt;CREATE VIEW view_name AS SELECT column1, column2 FROM table_name WHERE condition;&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
The above statement creates a view with &lt;strong&gt;view_name&lt;/strong&gt; name which retrieves &lt;strong&gt;column1&lt;/strong&gt;, &lt;strong&gt;column2&lt;/strong&gt; from table &lt;strong&gt;table_name&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now we can query the view as following&lt;/p&gt;

&lt;p&gt;&lt;code&gt;SELECT * FROM view_name&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Updating Views
&lt;/h4&gt;

&lt;p&gt;Views can also be updatable based on the certain criteria which has to be met (like no subqueries or aggregate functions). If the view is updatable then only the data can be inserted, deleted and updated in a view. Updating the data in a view doesn't actually update the data in a view since view is only the container for select statement instead it updates the data in underlying original tables.&lt;/p&gt;

&lt;h4&gt;
  
  
  Dropping Views
&lt;/h4&gt;

&lt;p&gt;Finally the views can be dropped as tables, indexes and other objects in databases using &lt;strong&gt;DROP&lt;/strong&gt; statement. &lt;br&gt;
Following is an example of dropping a view&lt;/p&gt;

&lt;p&gt;&lt;code&gt;DROP VIEW view_name&lt;/code&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Views In Mariadb (part 1)</title>
      <dc:creator>Syed Umer Tariq</dc:creator>
      <pubDate>Wed, 26 Apr 2023 14:43:10 +0000</pubDate>
      <link>https://dev.to/umerfreak/views-in-mariadb-1e2d</link>
      <guid>https://dev.to/umerfreak/views-in-mariadb-1e2d</guid>
      <description>&lt;p&gt;Views in mariadb are used for simplicity, access management and consistency. Views are basically virtual tables that do not store the data themselves instead take the data from base tables and show them as a single virtual table. We will see below the importance of views and how to create and use them.&lt;/p&gt;

&lt;p&gt;Views are simply the saved select statements which help us obtain data from one or more tables. These do not speed up the execution as these are only the saved select queries and do not save the retrieved data so they have to be run again and again each time the view is executed.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Advantages Of Views in Mariadb&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Views have following advantages in databases&lt;/p&gt;

&lt;h4&gt;
  
  
  Simplicity
&lt;/h4&gt;

&lt;p&gt;Views allow you to encapsulate complex queries with joins to simplify the table access. Instead of typing a long and complex query in multiple applications, you can create a view based on the query and use the view name in the applications.&lt;/p&gt;

&lt;h4&gt;
  
  
  Security
&lt;/h4&gt;

&lt;p&gt;In terms of security, you can grant a user account to access partial data of the base tables through a view. By doing this, you can hide the sensitive data from the users who do not have the privilege to view it.&lt;/p&gt;

&lt;h4&gt;
  
  
  Consistency
&lt;/h4&gt;

&lt;p&gt;Views can be used to encapsulate business logic and formulas and make them consistent across applications.&lt;/p&gt;

&lt;p&gt;In the next part we will see how to create and use the views &lt;a href="https://dev.to/umerfreak/views-in-mariadb-part-2-36k4"&gt;link for part2&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Execution Plan In Mariadb (2nd Part)</title>
      <dc:creator>Syed Umer Tariq</dc:creator>
      <pubDate>Sat, 15 Apr 2023 18:22:11 +0000</pubDate>
      <link>https://dev.to/umerfreak/execution-plan-in-mariadb-2nd-part-31eg</link>
      <guid>https://dev.to/umerfreak/execution-plan-in-mariadb-2nd-part-31eg</guid>
      <description>&lt;h2&gt;
  
  
  Interpreting the Execution Plan
&lt;/h2&gt;

&lt;p&gt;The execution plan can be difficult to read at first, but with some practice, you can learn to interpret it effectively. Here are some of the most important columns in the execution plan table:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;id:&lt;/strong&gt; This is a unique identifier for each step in the execution plan. The id column is used to show the order in which the steps will be executed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;select_type:&lt;/strong&gt; This column describes the type of SELECT statement that is being executed. There are several possible values for this column, including SIMPLE, PRIMARY, SUBQUERY, and UNION.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;table:&lt;/strong&gt; This column shows the name of the table that is being accessed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;type:&lt;/strong&gt; This column shows the type of access that is being used to access the table. There are several possible values for this column, including ALL, index, range, and ref.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;possible_keys:&lt;/strong&gt; This column shows the indexes that could potentially be used to access the table.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;key:&lt;/strong&gt; This column shows the index that is actually being used to access the table.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;rows:&lt;/strong&gt; This column shows the number of rows that will be examined for each step in the execution plan.&lt;/p&gt;

&lt;p&gt;Using the information in the execution plan, you can identify areas where you can optimize your query. For example, if you notice that the optimizer is performing a full table scan instead of using an index, you may want to consider adding an index to the table.&lt;/p&gt;

&lt;h2&gt;
  
  
  CONCLUSION
&lt;/h2&gt;

&lt;p&gt;The execution plan is a powerful tool that can help you optimize the performance of your MariaDB queries. By analyzing the plan, you can identify areas where you can improve the efficiency of your queries, resulting in faster and more responsive database applications. If you are new to MariaDB, it is highly recommended that you spend some time learning how to use the execution plan, as it can be an invaluable resource for optimizing your database queries.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Execution Plan In Mariadb (1st Part)</title>
      <dc:creator>Syed Umer Tariq</dc:creator>
      <pubDate>Sat, 15 Apr 2023 18:19:35 +0000</pubDate>
      <link>https://dev.to/umerfreak/execution-plan-in-mariadb-1st-part-2aej</link>
      <guid>https://dev.to/umerfreak/execution-plan-in-mariadb-1st-part-2aej</guid>
      <description>&lt;p&gt;MariaDB is an open-source database management system that is a fork of MySQL. It is widely used by developers for its reliability, scalability, and ease of use. In this article, we will discuss the &lt;strong&gt;execution plan&lt;/strong&gt; in MariaDB, which is a powerful tool that helps developers optimize the performance of their database queries.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is an Execution Plan?
&lt;/h2&gt;

&lt;p&gt;An execution plan is a detailed description of how MariaDB will execute a specific SQL query. It contains information about the order in which tables are accessed, the indexes used, and the operations performed on the data. The execution plan is generated by the query optimizer, which is a component of the MariaDB server that is responsible for determining the most efficient way to execute a query.&lt;/p&gt;

&lt;p&gt;The query optimizer considers a variety of factors when generating an execution plan, including the size of the tables involved, the complexity of the query, and the available indexes. By analyzing these factors, the optimizer can choose the best strategy for executing the query, which can result in significant performance improvements.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Generate an Execution Plan
&lt;/h2&gt;

&lt;p&gt;MariaDB provides several ways to generate an execution plan for a SQL query. The most common way is to use the EXPLAIN keyword, which displays information about the execution plan in a tabular format. To use the EXPLAIN keyword, simply prefix your SQL query with it, like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;EXPLAIN SELECT * FROM my_table WHERE my_column = 'value';&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;When you run this query, MariaDB will display a table that describes the execution plan for the query. The table will contain information about the tables that are accessed, the indexes used, and the operations performed on the data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Interpretation of Execution Plan is explained in 2nd part of the article. (&lt;a href="https://dev.to/umerfreak/execution-plan-in-mariadb-2nd-part-31eg"&gt;2nd part&lt;/a&gt;)&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Configure Size of Innodb Buffer Pool</title>
      <dc:creator>Syed Umer Tariq</dc:creator>
      <pubDate>Sat, 25 Mar 2023 21:55:51 +0000</pubDate>
      <link>https://dev.to/umerfreak/configure-size-of-innodb-buffer-pool-2kon</link>
      <guid>https://dev.to/umerfreak/configure-size-of-innodb-buffer-pool-2kon</guid>
      <description>&lt;p&gt;The size of the InnoDB Buffer Pool can be configured by setting the &lt;strong&gt;innodb_buffer_pool_size&lt;/strong&gt; system variable. the InnoDB Buffer Pool should usually be between 50%-75% of the memory available.&lt;/p&gt;

&lt;p&gt;There are two ways two configure innodb buffer pool size which are given as following&lt;/p&gt;

&lt;p&gt;1) The size of the InnoDB buffer pool can be changed dynamically by setting the innodb_buffer_pool_size system variable using the &lt;strong&gt;SET GLOBAL&lt;/strong&gt; statement which requires &lt;strong&gt;SUPER&lt;/strong&gt; privilege.&lt;/p&gt;

&lt;p&gt;To configure the InnoDB Buffer Pool with the &lt;strong&gt;SET GLOBAL&lt;/strong&gt; statement, use the following procedure:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Connect to the server using MariaDB Client as the root@localhost user account or another user account with the SUPER privilege&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Set the &lt;strong&gt;innodb_buffer_pool_size&lt;/strong&gt; system variable to the new size using the &lt;strong&gt;SET GLOBAL&lt;/strong&gt; statement.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, to set the size to 4 GB:&lt;/p&gt;

&lt;p&gt;SET GLOBAL innodb_buffer_pool_size=(4 * 1024 * 1024 * 1024);&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Confirm that the resize operation has been completed by querying the &lt;strong&gt;Innodb_buffer_pool_resize_status&lt;/strong&gt; status variable using the &lt;strong&gt;SHOW GLOBAL STATUS&lt;/strong&gt; statement&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;2) Changing the size of buffer pool by setting &lt;strong&gt;innodb_buffer_pool_size&lt;/strong&gt; system variable in configuration file. Ensure that your custom configuration file is read last by using the z- prefix in the file name so that changes made by you are not overwritten. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;innodb_buffer_pool_size&lt;/strong&gt; needs to be set in a group that will be read by MariaDB Server, such as [mariadb] or [server]. When set in a configuration file, the value supports units such as "M" (Megabyte), "G" (Gigabyte), etc. For this method server restart is needed to reflect the changes.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Important Concepts Related To Buffer Pool</title>
      <dc:creator>Syed Umer Tariq</dc:creator>
      <pubDate>Sat, 25 Mar 2023 21:44:30 +0000</pubDate>
      <link>https://dev.to/umerfreak/important-concepts-related-to-buffer-pool-43n8</link>
      <guid>https://dev.to/umerfreak/important-concepts-related-to-buffer-pool-43n8</guid>
      <description>&lt;p&gt;&lt;u&gt;&lt;strong&gt;Buffer Pool&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
Buffer pool is an in-memory cache used for faster access to frequently accessed data. It stores data and indexes reducing disk I/O.&lt;br&gt;
&lt;strong&gt;&lt;u&gt;Working of Buffer Pool&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Buffer pool mechanism works on the the two sublist concepts the &lt;strong&gt;new sublist&lt;/strong&gt; and the &lt;strong&gt;old sublist&lt;/strong&gt; where every item when accessed first time gets on the top of old sublist and on being called while in the old sublist moves to the top of new sublist. By default &lt;strong&gt;37%&lt;/strong&gt; of space is reserved for old-block.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;Size of Buffer Pool&lt;/u&gt;&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;The size of the buffer pool is determined by &lt;strong&gt;innodb_buffer_pool_size&lt;/strong&gt; system variable. The size of buffer pool should be adjusted per your needs to see the best performance. In order to configure the size of buffer pool set &lt;strong&gt;innodb_buffer_pool_size&lt;/strong&gt; system variable, the InnoDB Buffer Pool should usually be between 50%-75% of the memory available.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;2 ways to configure size of buffer pool&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;1) The size of the InnoDB buffer pool can be changed dynamically by setting the innodb_buffer_pool_size system variable using the SET GLOBAL statement which requires SUPER privilege.&lt;/p&gt;

&lt;p&gt;2)Changing the size of buffer pool by setting &lt;strong&gt;innodb_buffer_pool_size&lt;/strong&gt; system variable in configuration file. Ensure that your custom configuration file is read last by using the z- prefix in the file name so that changes made by you are not overwritten. &lt;br&gt;
&lt;strong&gt;innodb_buffer_pool_size&lt;/strong&gt; system variable in the configuration file.&lt;br&gt;
&lt;strong&gt;innodb_buffer_pool_size&lt;/strong&gt; needs to be set in a group that will be read by MariaDB Server, such as [mariadb] or [server]. When set in a configuration file, the value supports units such as "M" (Megabyte), "G" (Gigabyte), etc. For this method server restart is needed to reflect the changes.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;** Saving And Restoring Buffer Pool State**&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Innodb stores some percentage of most recently used pages from buffer pool at server shutdown and restores them at server restart. This is managed by &lt;strong&gt;innodb_buffer_pool_dump_pct&lt;/strong&gt; configuration option which is used to reduce warmup period.&lt;br&gt;
&lt;strong&gt;innodb_buffer_pool_dump_at_shutdown&lt;/strong&gt; and &lt;strong&gt;innodb_buffer_pool_load_at_startup&lt;/strong&gt; system variables should be enabled to allow buffer pool dump at shutdown and restore at server restart.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Some Important Points Related to Buffer Pool&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Pages are evicted using a least recently used (LRU) algorithm.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;InnoDB reserves additional memory for buffers and control structures, so that the total allocated space is approximately 10% greater than the specified buffer pool size.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The size of each page in the Buffer Pool depends on the value of the &lt;strong&gt;innodb_page_size&lt;/strong&gt; system variable.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>Buffer Pool in Innodb</title>
      <dc:creator>Syed Umer Tariq</dc:creator>
      <pubDate>Sun, 19 Mar 2023 21:59:34 +0000</pubDate>
      <link>https://dev.to/umerfreak/buffer-pool-in-innodb-2d3o</link>
      <guid>https://dev.to/umerfreak/buffer-pool-in-innodb-2d3o</guid>
      <description>&lt;p&gt;Buffer pool like in every storage engine plays an important and pivotal role in Innodb engine. Buffer pool stands out as one of the most important component in storage engine's architecture.&lt;/p&gt;

&lt;p&gt;Buffer pool is an area where frequently accessed data from tables and indexes is kept. When data is read from disk, it's loaded into the buffer pool, and subsequent reads can be served from memory instead of from disk which is the whole concept of creating a buffer pool. This can greatly improve performance because memory accesses are much faster than disk accesses.&lt;/p&gt;

&lt;p&gt;The buffer pool is configurable, and its size is determined by the innodb_buffer_pool_size configuration option. The default value for this option is 128MB, but it's often recommended to increase it to several gigabytes for high-performance workloads. Out of many configurations the user can do according to its requirements are resizing the buffer pool, splitting the buffer pool into multiple parts to minimize memory contention, when and how to perform read-ahead requests to prefetch pages and when to perform flushing.&lt;/p&gt;

&lt;p&gt;Buffer pool metrics can be monitored via Innodb standard monitor from which user can analyze the performance of buffer pool.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;WORKING OF BUFFER POOL&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;When InnoDB needs to read data from a table or index, it first checks if the data is already in the buffer pool. If it is, the data can be read directly from memory. If not, InnoDB reads the data from disk and loads it into the buffer pool. If the buffer pool is full, InnoDB will evict some data to make room for the new data.&lt;/p&gt;

&lt;p&gt;LRU (Least Recently Used) Algorithm is the backbone of eviction process through which data is stored in buffer pool.InnoDB keeps track of which pages in the buffer pool were accessed most recently and least recently, and when it needs to evict data, it chooses the least recently used pages to evict.&lt;/p&gt;

&lt;p&gt;InnoDB also uses a technique called "adaptive flushing" to manage the buffer pool. When the buffer pool is full and new data needs to be loaded, InnoDB will first try to flush some dirty pages to disk. Dirty pages are pages that have been modified in memory but haven't yet been written to disk. By flushing these pages to disk, InnoDB can free up space in the buffer pool for new data.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;Conclusion&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;The buffer pool is a critical component of InnoDB's architecture, and it's designed to improve performance by caching frequently accessed data in memory. By keeping data in memory, InnoDB can avoid disk accesses and serve requests much faster. The buffer pool is configurable, and its size should be set based on the workload and available memory. With a properly sized buffer pool, InnoDB can deliver excellent performance for transactional processing workloads.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Innodb Storage Engine (part 2)</title>
      <dc:creator>Syed Umer Tariq</dc:creator>
      <pubDate>Tue, 28 Feb 2023 13:51:43 +0000</pubDate>
      <link>https://dev.to/umerfreak/innodb-storage-engine-part-2-lh4</link>
      <guid>https://dev.to/umerfreak/innodb-storage-engine-part-2-lh4</guid>
      <description>&lt;p&gt;&lt;strong&gt;Performance and Scalability&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;InnoDB is designed for high-performance and high-concurrency environments. It provides good performance for both read-intensive and write-intensive workloads.&lt;/p&gt;

&lt;p&gt;InnoDB uses a buffer pool to cache frequently-accessed data in memory, which reduces disk I/O and improves performance. InnoDB also supports adaptive hash indexes, which can be used for frequently accessed small tables.&lt;/p&gt;

&lt;p&gt;InnoDB also supports multi-core CPUs and can take advantage of parallelism for certain operations, such as index creation and bulk data loading.&lt;/p&gt;

&lt;p&gt;InnoDB is also scalable and can handle large datasets. InnoDB supports tablespaces, which can be used to partition data across multiple physical storage devices. InnoDB also supports online schema changes, which allows for changes to the database schema without blocking concurrent transactions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;InnoDB in MariaDB And different from other Storage Engines in Mariadb&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;MariaDB is a community-developed fork of MySQL that aims to be a drop-in replacement for MySQL with additional features and improvements. MariaDB uses the same storage engines as MySQL, including InnoDB.&lt;/p&gt;

&lt;p&gt;Mariadb has multiple storage engines apart from Innodb and some of them are following &lt;strong&gt;MyIsam, Aria, Xtradb&lt;/strong&gt; but we need to see the differences of innodb from the rest of storage engine which has made it the default storage engine in mariadb from version 10.2.&lt;/p&gt;

&lt;p&gt;InnoDB is a popular storage engine in MariaDB, and it differs significantly from other storage engines such as MyISAM, Aria, and XtraDB. InnoDB provides transactional processing, MVCC, and row-level locking, which allows for high concurrency and data consistency. InnoDB also provides scalability features such as adaptive hash indexes, parallelism, and online schema changes.&lt;/p&gt;

&lt;p&gt;MyISAM, on the other hand, is faster for read-intensive workloads and has a smaller disk footprint for small tables. Aria is a simpler and more lightweight alternative to InnoDB that provides similar transactional features. XtraDB is a fork of InnoDB that includes performance and scalability improvements over the standard InnoDB.&lt;/p&gt;

&lt;p&gt;Choosing the right storage engine depends on the specific needs of the application. InnoDB is a good choice for applications that require high concurrency, data consistency, and scalability, while MyISAM may be more suitable for read-intensive workloads with small tables. Aria is a good alternative to InnoDB for simpler applications, while XtraDB is a good choice for high-performance and high-concurrency environments &lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
