<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel>
        <title>MySQL Forums - Partitioning</title>
        <description>Forum for MySQL Partitioning.</description>
        <link>https://forums.mysql.com/list.php?106</link>
        <lastBuildDate>Tue, 17 Mar 2026 12:49:47 +0000</lastBuildDate>
        <generator>Phorum 5.2.23</generator>
        <item>
            <guid>https://forums.mysql.com/read.php?106,740739,740739#msg-740739</guid>
            <title>Possible to partition on client id and year/month from timestamp? (1 reply)</title>
            <link>https://forums.mysql.com/read.php?106,740739,740739#msg-740739</link>
            <description><![CDATA[ Hi! Is it possible to partition on my_client_id and my_table_timestamp? I am not doing it for performance but rather the ability to archive and then delete entire partition per client id per month.<br />
<br />
Here&#039;s a sample DDL:<br />
<br />
CREATE TABLE `my_table` (<br />
  `my_client_id` int NOT NULL,<br />
  `my_table_id` bigint NOT NULL DEFAULT &#039;0&#039;, -- auto increment<br />
  `my_client_location_id` int DEFAULT NULL,<br />
  `my_table_timestamp` timestamp NOT NULL<br />
);<br />
<br />
Many thanks in advance,]]></description>
            <dc:creator>M Z</dc:creator>
            <category>Partitioning</category>
            <pubDate>Thu, 22 May 2025 13:32:36 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?106,740303,740303#msg-740303</guid>
            <title>Moving table partitions to different tablespace location (no replies)</title>
            <link>https://forums.mysql.com/read.php?106,740303,740303#msg-740303</link>
            <description><![CDATA[ I am trying to move partitions to a different location because we have reached the maximum limit at the host level, and it cannot be extended.<br />
<br />
I created a new tablespace and tried to move the partitioned tables. <br />
<br />
SQL<br />
<br />
mysql&gt; ALTER TABLE dummy_table TABLESPACE new_ts3;<br />
ERROR 1478 (HY000): InnoDB : A partitioned table is not allowed in a shared tablespace.<br />
mysql&gt;<br />
<br />
<br />
I created separate tablespaces for each partition:<br />
<br />
SQL<br />
<br />
mysql&gt; CREATE TABLESPACE ts2 ADD DATAFILE &#039;/u01/data/datafile2.ibd&#039; ENGINE=InnoDB;<br />
Query OK, 0 rows affected (0.01 sec)<br />
<br />
mysql&gt; CREATE TABLESPACE ts3 ADD DATAFILE &#039;/u01/data/datafile3.ibd&#039; ENGINE=InnoDB;<br />
Query OK, 0 rows affected (0.01 sec)<br />
<br />
mysql&gt; CREATE TABLESPACE ts4 ADD DATAFILE &#039;/u01/data/datafile4.ibd&#039; ENGINE=InnoDB;<br />
Query OK, 0 rows affected (0.00 sec)<br />
<br />
However, when I tried to move the partitions, I encountered a syntax error:<br />
<br />
SQL<br />
<br />
mysql&gt; ALTER TABLE dummy_table<br />
    -&gt; PARTITION p20250212 TABLESPACE ts1,<br />
    -&gt; PARTITION p20250213 TABLESPACE ts2,<br />
    -&gt; PARTITION p20250214 TABLESPACE ts3,<br />
    -&gt; PARTITION p20250215 TABLESPACE ts4,<br />
    -&gt; PARTITION p20250216 TABLESPACE ts5,<br />
    -&gt; PARTITION p20250217 TABLESPACE ts6,<br />
    -&gt; PARTITION p20250218 TABLESPACE ts7,<br />
    -&gt; PARTITION p20250219 TABLESPACE ts8,<br />
    -&gt; PARTITION p20250220 TABLESPACE ts9;<br />
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#039;PARTITION p20250212 TABLESPACE ts1,<br />
PARTITION p20250213 TABLESPACE ts2,<br />
PARTITION p20250214 TABLESPACE ts3&#039; at line 2<br />
mysql&gt;<br />
<br />
Any other way to go forward?]]></description>
            <dc:creator>SUJITH NAIR</dc:creator>
            <category>Partitioning</category>
            <pubDate>Fri, 21 Feb 2025 04:10:35 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?106,705743,705743#msg-705743</guid>
            <title>Export/Import with table partitioning (3 replies)</title>
            <link>https://forums.mysql.com/read.php?106,705743,705743#msg-705743</link>
            <description><![CDATA[ Hi,<br />
<br />
I&#039;m newbie, so I&#039;m sorry. I&#039;m trying migrate a 5.6 mysql database to mariadb (a more new version).<br />
<br />
I have a full database backup done (not sure if it&#039;s correct with all data). When I do import in target mariadb database all is ok. But I&#039;ve compared datadir size and it is different. Source is 144MB and target is 84MB, so I&#039;ve thought that something is bad.<br />
<br />
I&#039;ve compared files with different sizes and I&#039;ve compared this tables and I&#039;ve seen that in source DB it has partitions. These partitions are not in target, so I think that it is the problem. What I don&#039;t understand is that when I do select count(*) in this tables, it shows same rows in source and target (not sure if in source it is counting partitioned data :-?).<br />
<br />
Could someone help me please about how could I export all data and import in mariadb database and all is ok (with partitions)? :-) Thanks beforehand.<br />
<br />
Cheers...]]></description>
            <dc:creator>tempman tempman</dc:creator>
            <category>Partitioning</category>
            <pubDate>Thu, 11 Aug 2022 13:00:42 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?106,705628,705628#msg-705628</guid>
            <title>Strange values in information_schema.partitions (no replies)</title>
            <link>https://forums.mysql.com/read.php?106,705628,705628#msg-705628</link>
            <description><![CDATA[ We have a Zabbix server that uses MySQL 8.0.28 as DB, installed on an instance of Azure MySQL Flexible Server.<br />
We apply a quite usual workaround for Zabbix installations with a large volume of data, which is to partition certain types of tables (the original Zabbix design does not contemplate it) on a daily basis, using,<br />
in our case, a python script that runs regularly every day. This script checks which partitions are older than a pre-set threshold (in my case 6 days) and deletes them.<br />
It also checks if it needs more partitions, in such a way that always ahead of the data partition that corresponds to the current day, we leave a number of empty partitions established in advance (in my case 10 days).<br />
In normal operation of the script, per day, it deletes one partition (the one that is older than the expected threshold) and creates a future partition.<br />
<br />
For a few days now, I am watching some &quot;weird&quot; values ​​in the information_schema.partitions table in the create_date and update_date fields.<br />
For example, for this morning&#039;s run, for one of the partitioned tables you see the following:<br />
<br />
mysql&gt; select table_schema, table_name, partition_name, table_rows, create_time, update_time from partitions where table_name = &#039;history&#039;;<br />
+--------------+------------+----------------+------------+---------------------+---------------------+<br />
| TABLE_SCHEMA | TABLE_NAME | PARTITION_NAME | TABLE_ROWS | CREATE_TIME         | UPDATE_TIME         |<br />
+--------------+------------+----------------+------------+---------------------+---------------------+<br />
| zabbix       | history    | p2022_07_28    |   53687400 | 2022-08-03 03:32:25 | NULL                |<br />
| zabbix       | history    | p2022_07_29    |   48749688 | 2022-08-03 03:32:25 | NULL                |<br />
| zabbix       | history    | p2022_07_30    |   53768640 | 2022-08-03 03:32:25 | NULL                |<br />
| zabbix       | history    | p2022_07_31    |   52771337 | 2022-08-03 03:32:25 | NULL                |<br />
| zabbix       | history    | p2022_08_01    |   50966961 | 2022-08-03 03:32:25 | NULL                |<br />
| zabbix       | history    | p2022_08_02    |   53817777 | 2022-08-03 03:32:25 | NULL                |<br />
| zabbix       | history    | p2022_08_03    |   21373932 | 2022-08-03 03:32:25 | 2022-08-03 08:56:12 |<br />
| zabbix       | history    | p2022_08_04    |          0 | 2022-08-03 03:32:25 | NULL                |<br />
| zabbix       | history    | p2022_08_05    |          0 | 2022-08-03 03:32:25 | NULL                |<br />
| zabbix       | history    | p2022_08_06    |          0 | 2022-08-03 03:32:25 | NULL                |<br />
| zabbix       | history    | p2022_08_07    |          0 | 2022-08-03 03:32:25 | NULL                |<br />
| zabbix       | history    | p2022_08_08    |          0 | 2022-08-03 03:32:25 | NULL                |<br />
| zabbix       | history    | p2022_08_09    |          0 | 2022-08-03 03:32:25 | NULL                |<br />
| zabbix       | history    | p2022_08_10    |          0 | 2022-08-03 03:32:25 | NULL                |<br />
| zabbix       | history    | p2022_08_11    |          0 | 2022-08-03 03:32:25 | NULL                |<br />
| zabbix       | history    | p2022_08_12    |          0 | 2022-08-03 03:32:25 | NULL                |<br />
| zabbix       | history    | p2022_08_13    |          0 | 2022-08-03 03:32:25 | NULL                |<br />
+--------------+------------+----------------+------------+---------------------+---------------------+<br />
17 rows in set (0.00 sec)<br />
<br />
It is observed in the create_time field that all the partitions have today&#039;s date, when the partitioning script is executed.<br />
Actually, following the logs of the partitioning script, the only partition that was created today was p2022_08_13.<br />
In the update_time field, it looks like today&#039;s partition, obviously registering activity, which is logical, but nevertheless<br />
partitions from previous days, which have data and have had previous similar activity, turn out to have a &quot;NULL&quot; value, when it should, I think,<br />
have an adequate value on the day of the partition. <br />
For example, a logical value for p2022_07_28 could be 2022-07-28 23:59:00 or even 2022-07-29 00:03:00 for transactions that had not been completed before the start of the partition the following day.<br />
<br />
For a few days now I have been noticing performance issues with the Zabbix application and the partitioning script.<br />
It turns out that the script takes much longer to perform partition management, specifically deleting the partition that is older than 6 days.<br />
Today, for example, it took about three minutes to delete the p2022_07_27 partition from the history table, when it usually does not reach the minute of execution. It is a partition with a lot of data.<br />
Doing a full system check I don&#039;t see errors in MySQL, only evidence that there are I/O performance issues and that there are slow queries, coinciding in time with the execution of the partitioning script.<br />
The partitioning script does not log execution errors.<br />
In Zabbix overloads are observed in the internal process history_syncer that precisely setup monitoring data on the history tables.<br />
<br />
That&#039;s when I&#039;ve found these &quot;weird&quot; values ​​in the partitions table. This same situation is systematically repeated every day and I don&#039;t know if it really is the origin of my problems.<br />
<br />
<br />
<br />
Any suggestion?]]></description>
            <dc:creator>Carlos Simó</dc:creator>
            <category>Partitioning</category>
            <pubDate>Wed, 03 Aug 2022 10:48:19 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?106,704753,704753#msg-704753</guid>
            <title>need help for partition on tables with foreign keys (7 replies)</title>
            <link>https://forums.mysql.com/read.php?106,704753,704753#msg-704753</link>
            <description><![CDATA[ We have a few very huge tables in our dbs which need partitioning， with relationship between them.<br />
such as transaction and transaction_log<br />
transaction table records a serial of transactions from our application <br />
<br />
CREATE TABLE TRANSACTION<br />
(<br />
TRANS_ID VARCHAR(10) NOT NULL,<br />
CREATION_DATE DATETIME NOT NULL,<br />
......................<br />
PRIMARY KEY (TRANS_ID)<br />
);<br />
<br />
<br />
transaction_log table records all child events happened on the transaction since the transaction was created, like approval, decline, cancellation of the transaction<br />
It can be joined to transaction table with TRANS_ID<br />
<br />
CREATE TABLE TRANSACTION<br />
(<br />
TRANS_EVENT_ID VARCHAR(10) NOT NULL,<br />
TRANS_ID VARCHAR(10) NOT NULL,<br />
LAST_UPDATE_DATE DATETIME NOT NULL,<br />
......................<br />
PRIMARY KEY (TRANS_EVENT_ID )<br />
);<br />
<br />
<br />
The transaction table has TRANS_ID and creation_timestamp<br />
THe transaction_event table has another ID and last_update of the event, both primary ID are random generated 10 digit string, and transaction_event table can be joined to transaction table using trans_ID<br />
<br />
If we put partitioning on those tables based on date_time, it will cause problem when we drop and purge paritioning, for example, if we drop partition for 2020-12 partition on both transaction and event table, since transaction table is based <br />
on creation timestamp, and event table is by last updated timestamp, the drop partitioing will fail because of the foreign key constrain.<br />
<br />
We can&#039;t put partition based on ID either, because ID is randomly generated. <br />
<br />
I cant find the best way for do this, i really appreciate if you could provide some suggestions.]]></description>
            <dc:creator>Johnson WIlson</dc:creator>
            <category>Partitioning</category>
            <pubDate>Wed, 08 Jun 2022 16:22:07 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?106,704632,704632#msg-704632</guid>
            <title>Issue with Partitioning (1 reply)</title>
            <link>https://forums.mysql.com/read.php?106,704632,704632#msg-704632</link>
            <description><![CDATA[ I have done some tests to study about partitioning , so that I can implement it to my live database that is having large data.<br />
Step 1:<br />
<br />
CREATE TABLE tr (id INT, name VARCHAR(50), purchased DATE)<br />
    PARTITION BY RANGE(year(purchased)) <br />
	(<br />
        PARTITION p0 VALUES LESS THAN (1990),<br />
        PARTITION p1 VALUES LESS THAN (1995),<br />
        PARTITION p2 VALUES LESS THAN (2000),<br />
        PARTITION p3 VALUES LESS THAN (2005),<br />
        PARTITION p4 VALUES LESS THAN (2010),<br />
        PARTITION p5 VALUES LESS THAN (2015),<br />
        PARTITION pmax VALUES LESS THAN MAXVALUE<br />
    );<br />
<br />
Setp 2:<br />
<br />
INSERT INTO tr VALUES<br />
     (1, &#039;Store1&#039;, &#039;2003-10-15&#039;),<br />
     (2, &#039;Store1&#039;, &#039;1997-11-05&#039;),<br />
     (3, &#039;Store1&#039;, &#039;2009-03-10&#039;),<br />
     (4, &#039;Store2&#039;, &#039;1989-01-10&#039;),<br />
     (5, &#039;Store1&#039;, &#039;2014-05-09&#039;),<br />
     (6, &#039;Store1&#039;, &#039;1987-06-05&#039;),<br />
     (7, &#039;Store3&#039;, &#039;2011-11-22&#039;),<br />
     (8, &#039;Store3&#039;, &#039;1992-08-04&#039;),<br />
     (9, &#039;Store4&#039;, &#039;2006-09-16&#039;),<br />
     (10, &#039;Store4&#039;, &#039;1998-12-25&#039;);<br />
<br />
Step 3:<br />
<br />
EXPLAIN SELECT * FROM tr WHERE purchased BETWEEN &#039;1987-06-05&#039; AND &#039;1989-01-10&#039;;<br />
<br />
in this step when am retriving data it only using p0 partition which is correct.<br />
<br />
Setp 4:<br />
<br />
EXPLAIN SELECT * FROM tr WHERE YEAR(purchased) BETWEEN 1987 AND 1989;<br />
<br />
in this step I just changed the where query to check the data based on year only not a full date.Here in this case the query searching in whole partition.<br />
I don&#039;t understand why it is working like this.Please explain if there is any mistake so that i can update my steps and complete the work.]]></description>
            <dc:creator>sreenath kn</dc:creator>
            <category>Partitioning</category>
            <pubDate>Mon, 06 Jun 2022 01:48:07 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?106,698346,698346#msg-698346</guid>
            <title>Wrong index used in SELECT , ROW_NUMBER() OVER (PARTITION BY (3 replies)</title>
            <link>https://forums.mysql.com/read.php?106,698346,698346#msg-698346</link>
            <description><![CDATA[ Hi! It appears MySQL 8.0.23 optimizer uses wrong index in queries using SELECT * , ROW_NUMBER() OVER (PARTITION BY ....<br />
How do you index the table for my query? Here&#039;s the modified DDL and DML<br />
<br />
-- DDL:<br />
----------------------------<br />
CREATE TABLE `test_table` (<br />
  `client_id` int DEFAULT NULL,<br />
  `division_id` int DEFAULT NULL,<br />
  `some_val` float DEFAULT NULL,<br />
  `end_date` timestamp NULL DEFAULT NULL,<br />
  `department_id` int DEFAULT NULL,<br />
  `some_data` varchar(45) DEFAULT NULL,<br />
  KEY `idx_client_enddate_division` (`client_id`,`end_date`,`division_id`),<br />
  KEY `idx_some_val` (`some_val` DESC),<br />
  KEY `idx_client_division` (`client_id`,`division_id`),<br />
  KEY `idx_client_department` (`client_id`,`department_id`)<br />
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci<br />
/*!50100 PARTITION BY LIST (`client_id`)<br />
(PARTITION part_null VALUES IN (NULL) ENGINE = InnoDB,<br />
 PARTITION part_neg_one VALUES IN (-1) ENGINE = InnoDB,<br />
 PARTITION a100 VALUES IN (100) ENGINE = InnoDB,<br />
 PARTITION a101 VALUES IN (101) ENGINE = InnoDB,<br />
 PARTITION a102 VALUES IN (102) ENGINE = InnoDB,<br />
 PARTITION a103 VALUES IN (103) ENGINE = InnoDB) */;<br />
<br />
<br />
-- DATA<br />
---------------------------------<br />
INSERT INTO test_table(client_id, division_id, some_val, end_date, department_id, some_data) VALUES<br />
(100, 1, 35.78, &#039;2021-11-13 12:25:04&#039;, NULL, NULL),<br />
(100, 1, 0.956245, &#039;2022-04-09 05:24:48&#039;, NULL, NULL),<br />
(100, 1, 0.861436, &#039;2022-02-12 01:04:55&#039;, NULL, NULL),<br />
(100, 1, 0.761067, &#039;2023-07-29 05:49:36&#039;, NULL, NULL),<br />
(100, 1, 0.707362, &#039;2022-08-30 14:57:18&#039;, NULL, NULL),<br />
(100, 1, 0.590262, &#039;2022-03-24 01:41:34&#039;, NULL, NULL),<br />
(100, 1, 0.848734, &#039;2022-02-14 03:33:34&#039;, NULL, NULL),<br />
(100, 1, 0.813579, &#039;2022-01-30 14:22:59&#039;, NULL, NULL),<br />
(100, 1, 0.819393, &#039;2022-04-05 11:13:52&#039;, NULL, NULL),<br />
(100, 1, 0.246256, &#039;2021-12-29 21:55:56&#039;, NULL, NULL),<br />
(100, 1, 0.304336, &#039;2023-05-15 13:37:22&#039;, NULL, NULL),<br />
(100, 1, 0.566081, &#039;2021-11-11 23:25:52&#039;, NULL, NULL),<br />
(100, 1, 0.0165217, &#039;2022-11-19 20:34:28&#039;, NULL, NULL),<br />
(100, 1, 0.21918, &#039;2021-11-05 22:01:14&#039;, NULL, NULL),<br />
(100, 1, 0.0157273, &#039;2022-12-05 03:12:42&#039;, NULL, NULL),<br />
(100, 1, 0.326197, &#039;2022-10-16 16:49:26&#039;, NULL, NULL),<br />
(100, 1, 0.056206, &#039;2022-07-01 12:44:24&#039;, NULL, NULL),<br />
(100, 2, 0.132138, &#039;2022-02-20 04:37:58&#039;, NULL, NULL),<br />
(100, 2, 0.00476808, &#039;2021-12-11 07:20:57&#039;, NULL, NULL),<br />
(100, 2, 0.901352, &#039;2023-06-29 11:55:47&#039;, NULL, NULL),<br />
(100, 2, 0.0827709, &#039;2022-08-30 02:30:30&#039;, NULL, NULL),<br />
(100, 2, 0.460482, &#039;2022-12-06 22:16:54&#039;, NULL, NULL),<br />
(100, 2, 0.00422428, &#039;2023-07-23 02:45:55&#039;, NULL, NULL),<br />
(100, 2, 0.935921, &#039;2022-12-31 05:59:29&#039;, NULL, NULL),<br />
(100, 2, 0.74449, &#039;2022-10-05 02:56:12&#039;, NULL, NULL),<br />
(100, 2, 0.722022, &#039;2023-04-02 11:51:48&#039;, NULL, NULL),<br />
(100, 3, 0.0180021, &#039;2022-09-26 16:57:38&#039;, NULL, NULL),<br />
(100, 3, 0.843845, &#039;2022-07-16 09:28:08&#039;, NULL, NULL),<br />
(100, 3, 0.871028, &#039;2023-05-28 13:15:08&#039;, NULL, NULL),<br />
(100, 3, 0.95494, &#039;2021-08-24 08:33:43&#039;, NULL, NULL),<br />
(100, 3, 0.304606, &#039;2022-06-03 05:23:45&#039;, NULL, NULL),<br />
(100, 3, 0.19306, &#039;2022-12-24 11:27:13&#039;, NULL, NULL),<br />
(100, 3, 0.926688, &#039;2022-08-21 11:02:35&#039;, NULL, NULL),<br />
(100, 3, 0.869524, &#039;2023-02-03 20:43:32&#039;, NULL, NULL),<br />
(100, 3, 0.180765, &#039;2022-11-02 16:23:13&#039;, NULL, NULL),<br />
(100, 3, 0.608817, &#039;2021-11-19 14:48:45&#039;, NULL, NULL),<br />
(100, 3, 0.940649, &#039;2022-01-23 23:56:26&#039;, NULL, NULL),<br />
(100, 3, 0.392966, &#039;2022-01-18 19:32:53&#039;, NULL, NULL),<br />
(100, 3, 0.00051388, &#039;2022-03-02 21:56:07&#039;, NULL, NULL),<br />
(100, 3, 0.473072, &#039;2022-07-16 10:49:32&#039;, NULL, NULL),<br />
(100, 3, 0.983735, &#039;2022-07-13 18:15:20&#039;, NULL, NULL),<br />
(100, 3, 0.433318, &#039;2023-01-18 19:24:53&#039;, NULL, NULL),<br />
(101, 7, 0.867828, &#039;2023-02-22 21:51:02&#039;, NULL, NULL),<br />
(101, 7, 0.31631, &#039;2022-01-14 06:44:16&#039;, NULL, NULL),<br />
(101, 7, 0.199429, &#039;2022-03-12 13:21:03&#039;, NULL, NULL),<br />
(101, 7, 0.942369, &#039;2023-02-25 11:00:54&#039;, NULL, NULL),<br />
(101, 7, 0.110144, &#039;2021-12-15 03:06:48&#039;, NULL, NULL),<br />
(101, 7, 0.611413, &#039;2022-07-24 18:00:36&#039;, NULL, NULL),<br />
(101, 7, 0.625555, &#039;2022-11-18 12:09:26&#039;, NULL, NULL),<br />
(101, 7, 0.382829, &#039;2023-06-30 06:53:03&#039;, NULL, NULL),<br />
(101, 7, 0.64375, &#039;2022-04-07 07:22:21&#039;, NULL, NULL),<br />
(101, 7, 0.785784, &#039;2023-05-17 16:06:40&#039;, NULL, NULL),<br />
(101, 7, 0.136147, &#039;2023-07-19 09:44:43&#039;, NULL, NULL),<br />
(101, 7, 0.514747, &#039;2022-10-26 02:08:49&#039;, NULL, NULL),<br />
(101, 7, 0.554862, &#039;2023-05-29 11:04:18&#039;, NULL, NULL),<br />
(101, 7, 0.909665, &#039;2023-03-09 09:01:45&#039;, NULL, NULL),<br />
(101, 11, 0.289879, &#039;2021-08-27 09:53:48&#039;, NULL, NULL),<br />
(101, 11, 0.320718, &#039;2022-07-22 20:45:40&#039;, NULL, NULL),<br />
(101, 11, 0.484727, &#039;2023-06-28 03:22:58&#039;, NULL, NULL),<br />
(101, 11, 0.323356, &#039;2023-01-29 07:24:45&#039;, NULL, NULL),<br />
(101, 11, 0.781222, &#039;2022-11-21 00:22:52&#039;, NULL, NULL),<br />
(101, 11, 0.933015, &#039;2022-12-22 22:31:01&#039;, NULL, NULL),<br />
(101, 11, 0.696283, &#039;2022-05-07 02:22:56&#039;, NULL, NULL),<br />
(101, 11, 0.83224, &#039;2021-08-05 20:35:50&#039;, NULL, NULL),<br />
(101, 11, 0.546006, &#039;2022-12-26 19:53:45&#039;, NULL, NULL),<br />
(101, 11, 0.883958, &#039;2022-03-11 10:38:08&#039;, NULL, NULL),<br />
(101, 11, 0.881157, &#039;2022-07-20 08:59:56&#039;, NULL, NULL),<br />
(101, 11, 0.786355, &#039;2022-07-11 13:14:47&#039;, NULL, NULL),<br />
(101, 11, 0.0103294, &#039;2022-11-02 12:40:47&#039;, NULL, NULL),<br />
(101, 11, 0.119066, &#039;2022-12-27 11:41:08&#039;, NULL, NULL),<br />
(101, 11, 0.169285, &#039;2023-01-14 21:53:42&#039;, NULL, NULL),<br />
(102, 3, 0.379421, &#039;2022-12-15 22:34:06&#039;, NULL, NULL),<br />
(102, 3, 0.309135, &#039;2022-07-14 00:03:25&#039;, NULL, NULL),<br />
(102, 3, 0.458774, &#039;2023-04-20 23:57:12&#039;, NULL, NULL),<br />
(102, 3, 0.934485, &#039;2021-10-01 08:35:20&#039;, NULL, NULL),<br />
(102, 3, 0.626253, &#039;2023-04-29 05:35:52&#039;, NULL, NULL),<br />
(102, 3, 0.488451, &#039;2023-03-22 15:02:46&#039;, NULL, NULL),<br />
(102, 3, 0.644282, &#039;2023-02-02 05:29:07&#039;, NULL, NULL),<br />
(102, 3, 0.845293, &#039;2023-07-01 02:47:37&#039;, NULL, NULL),<br />
(102, 3, 0.262038, &#039;2022-06-10 13:41:56&#039;, NULL, NULL),<br />
(102, 3, 0.371081, &#039;2022-09-13 05:07:40&#039;, NULL, NULL),<br />
(102, 3, 0.692191, &#039;2023-02-18 08:07:28&#039;, NULL, NULL),<br />
(102, 3, 0.811907, &#039;2023-01-11 22:12:11&#039;, NULL, NULL),<br />
(102, 3, 0.196504, &#039;2023-03-08 22:43:33&#039;, NULL, NULL),<br />
(102, 3, 0.426422, &#039;2023-01-09 01:57:13&#039;, NULL, NULL),<br />
(102, 3, 0.33348, &#039;2022-07-30 10:34:25&#039;, NULL, NULL),<br />
(102, 5, 0.498327, &#039;2023-07-25 01:18:24&#039;, NULL, NULL),<br />
(102, 5, 0.466895, &#039;2022-04-17 11:39:14&#039;, NULL, NULL),<br />
(102, 5, 0.386062, &#039;2023-04-18 03:39:04&#039;, NULL, NULL),<br />
(102, 5, 0.133126, &#039;2021-10-04 22:28:22&#039;, NULL, NULL),<br />
(102, 5, 0.0548398, &#039;2021-07-31 20:06:42&#039;, NULL, NULL),<br />
(102, 5, 0.84382, &#039;2022-01-02 21:51:26&#039;, NULL, NULL),<br />
(102, 5, 0.539021, &#039;2021-09-07 04:16:06&#039;, NULL, NULL),<br />
(102, 5, 0.647028, &#039;2021-09-24 14:22:20&#039;, NULL, NULL),<br />
(102, 5, 0.442331, &#039;2023-07-17 04:38:53&#039;, NULL, NULL),<br />
(102, 5, 0.581043, &#039;2023-07-01 16:57:05&#039;, NULL, NULL),<br />
(102, 5, 0.0588302, &#039;2022-05-28 02:14:01&#039;, NULL, NULL),<br />
(102, 5, 0.88839, &#039;2021-12-25 19:51:54&#039;, NULL, NULL),<br />
(102, 5, 0.349947, &#039;2021-11-10 07:19:22&#039;, NULL, NULL),<br />
(102, 5, 0.653479, &#039;2023-04-08 18:20:14&#039;, NULL, NULL),<br />
(102, 5, 0.266575, &#039;2023-03-04 04:29:29&#039;, NULL, NULL),<br />
(102, 5, 0.18361, &#039;2022-08-20 02:17:14&#039;, NULL, NULL),<br />
(102, 5, 0.0894101, &#039;2023-04-21 13:01:31&#039;, NULL, NULL),<br />
(102, 5, 0.0463059, &#039;2022-11-11 20:53:06&#039;, NULL, NULL),<br />
(102, 5, 0.0751218, &#039;2022-06-22 01:34:27&#039;, NULL, NULL),<br />
(102, 5, 0.0105604, &#039;2022-12-31 19:55:54&#039;, NULL, NULL),<br />
(102, 5, 0.524552, &#039;2022-07-22 14:31:27&#039;, NULL, NULL),<br />
(102, 5, 0.871445, &#039;2023-05-11 10:33:45&#039;, NULL, NULL),<br />
(102, 5, 0.836485, &#039;2022-08-08 07:57:38&#039;, NULL, NULL),<br />
(102, 5, 0.0502111, &#039;2023-01-03 18:10:27&#039;, NULL, NULL),<br />
(102, 5, 0.425646, &#039;2023-07-17 19:39:04&#039;, NULL, NULL),<br />
(102, 5, 0.635379, &#039;2022-01-14 03:47:27&#039;, NULL, NULL),<br />
(102, 5, 0.241381, &#039;2022-08-13 01:09:25&#039;, NULL, NULL);<br />
<br />
QUERY:<br />
------------------------------------<br />
<br />
explain SELECT m.*, ROW_NUMBER() OVER (PARTITION BY airline_id, end_date, fleet_id ORDER BY aqi DESC) AS rn<br />
		FROM pollutant_aggregated_data m <br />
		WHERE airline_id = 115		<br />
		AND end_date &lt;= &#039;2022-07-30 14:53:27&#039; <br />
		AND end_date &gt;= &#039;2020-07-30 14:53:27&#039; <br />
        AND fleet_id is not null  ;<br />
<br />
<br />
So the optimizer picks idx_client_department instead of idx_client_enddate_division.<br />
<br />
What am I doing wrong? How would you index this table for the aforementioned query? <br />
<br />
Infinite thanks in advance.]]></description>
            <dc:creator>M Z</dc:creator>
            <category>Partitioning</category>
            <pubDate>Sat, 28 Aug 2021 05:58:37 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?106,694026,694026#msg-694026</guid>
            <title>Need help in setting up partition (year and month - key partition) to MySQL Document store collection (no replies)</title>
            <link>https://forums.mysql.com/read.php?106,694026,694026#msg-694026</link>
            <description><![CDATA[ Hi Team,<br />
<br />
I am new to MySQL document store. I have created a collection (my_notes) in MySQL 8.x document store, inserted sample json documents into it, which is working fine. Now i need to apply partition to this collection. Please let me know how can create key partition for the collection.<br />
<br />
Thanks,<br />
vasundhara.]]></description>
            <dc:creator>Vasundhara Ranga</dc:creator>
            <category>Partitioning</category>
            <pubDate>Tue, 05 Jan 2021 13:26:05 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?106,694025,694025#msg-694025</guid>
            <title>MySQL Document store (no replies)</title>
            <link>https://forums.mysql.com/read.php?106,694025,694025#msg-694025</link>
            <description><![CDATA[ Hi Team,<br />
<br />
I am new to MySQL document store. I have created a collection (my_notes) in MySQL document store, inserted sample json documents into it, which is working fine. Now i need to apply partition to this collection. Please let me know how can create key partition for the collection.<br />
<br />
Thanks,<br />
vasundhara.]]></description>
            <dc:creator>Vasundhara Ranga</dc:creator>
            <category>Partitioning</category>
            <pubDate>Tue, 05 Jan 2021 12:25:48 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?106,691703,691703#msg-691703</guid>
            <title>Mysql 8.0.22 - Indexes on virtual columns do not update (1 reply)</title>
            <link>https://forums.mysql.com/read.php?106,691703,691703#msg-691703</link>
            <description><![CDATA[ I have an original replication setup consisting of two OLTP mysql instances (5.7.31 on Centos 7) and two OLAP (5.7.30 on Solaris). The schemas on the OLAP servers differ from OLTP in two significant ways:<br />
1. several tables have computed (i.e. columns) columns that are build by applying: <br />
* a cast to date on a VARCHAR timestamp<br />
* a hashing function on VARCHAR columns<br />
2. the tables that have the above enhancements have been provided with indexes on the computed columns<br />
The original replication setup has been working perfectly for several months withou issue.<br />
I decided to add three new OLAP devices in an effort to remove the solaris nodes AND upgrade to the newer version of mysql.<br />
<br />
The three new instances use mysql 8.0.14 (on Centos 7) and get replication from one the OLAP nodes. This new setup was also working as expected and everything was being updated as normal.<br />
<br />
The next step was to decouple the three new OLAP nodes from the old OLAP nodes and have them receive replication directly from the OLTP nodes. I first upgraded the new nodes to 8.0.22 without issue and I switched their master configuration to the OLTP servers. The row updates started coming through as expected, the computed columns were complete however the indexes on the computed columns stopped updating. <br />
<br />
I can retrieve data using the indexes up to the point when I made the change but since then the indexed receive NO updates. I also tried to create copies of the indexes (different name) and again I noticed that the new indexes were complete up to the creation point-in-time but they received no updates after that.]]></description>
            <dc:creator>Vasilis Kioustelidis</dc:creator>
            <category>Partitioning</category>
            <pubDate>Mon, 07 Dec 2020 21:24:42 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?106,690800,690800#msg-690800</guid>
            <title>Need help to create auto increment partition based on date (no replies)</title>
            <link>https://forums.mysql.com/read.php?106,690800,690800#msg-690800</link>
            <description><![CDATA[ Dear Team,<br />
<br />
I am new to mysql.I have been exploring possibility to create partition based on date.So did came across key partition case be used with date field ,however in such case number of partition is fixed.I have shared the sample sql.<br />
<br />
create table test_date_partition<br />
(name varchar(100),<br />
dept varchar(100),<br />
salary integer,<br />
join_date date not null)<br />
partition by key(join_date)<br />
partitions 6;<br />
<br />
<br />
However, I want partition in which partition should auto increment and need basis partition with old date can be dropped.Is there any method or solution to solve this issue?<br />
<br />
Thanks in Advance!!!<br />
<br />
Regards,<br />
Tanmoy Moulik]]></description>
            <dc:creator>Tanmoy Moulik</dc:creator>
            <category>Partitioning</category>
            <pubDate>Wed, 28 Oct 2020 10:30:50 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?106,690581,690581#msg-690581</guid>
            <title>Locking (no replies)</title>
            <link>https://forums.mysql.com/read.php?106,690581,690581#msg-690581</link>
            <description><![CDATA[ Hi,<br />
<br />
I am trying to find more information on what locks would be applies when using the command: <br />
<br />
ALTER TABLE ... DROP PARTITION ...<br />
<br />
I am particularly interested in how this compares to TRUNCATE PARTITION<br />
<br />
Whilst I can find documentation on truncate I cant seem to find anything conclusive on drop.<br />
<br />
I have a hunch that DROP will lock the whole table whereas truncate will prune lock, only locking the data to be deleted.<br />
<br />
Hoping someone here can provide some clarification, and or point me to the correct docs. <br />
<br />
Here are some of the places I have already looked:<br />
<a href="https://dev.mysql.com/doc/refman/5.7/en/partitioning-limitations-locking.html"  rel="nofollow">https://dev.mysql.com/doc/refman/5.7/en/partitioning-limitations-locking.html</a><br />
<a href="https://dev.mysql.com/doc/refman/5.6/en/lock-tables.html"  rel="nofollow">https://dev.mysql.com/doc/refman/5.6/en/lock-tables.html</a><br />
<a href="https://dev.mysql.com/doc/refman/5.6/en/innodb-locking.html"  rel="nofollow">https://dev.mysql.com/doc/refman/5.6/en/innodb-locking.html</a><br />
<br />
Would like to know what happens in V5.6 / 5.7]]></description>
            <dc:creator>Alex Brown</dc:creator>
            <category>Partitioning</category>
            <pubDate>Wed, 14 Oct 2020 07:32:49 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?106,690267,690267#msg-690267</guid>
            <title>MySQL: automatic partitions surely would be nice (no replies)</title>
            <link>https://forums.mysql.com/read.php?106,690267,690267#msg-690267</link>
            <description><![CDATA[ MySQL: automatic partitions surely would be nice<br />
— <a href="https://blog.koehntopp.info/2020/09/25/mysql-dynamic-partitions-suck.html"  rel="nofollow">https://blog.koehntopp.info/2020/09/25/mysql-dynamic-partitions-suck.html</a>]]></description>
            <dc:creator>Edwin Desouza</dc:creator>
            <category>Partitioning</category>
            <pubDate>Fri, 25 Sep 2020 16:19:44 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?106,689967,689967#msg-689967</guid>
            <title>Add new LIST partition based on passed id in stored proc? (3 replies)</title>
            <link>https://forums.mysql.com/read.php?106,689967,689967#msg-689967</link>
            <description><![CDATA[ Hi! Thank you for taking a look.<br />
I have a table with LIST partitioning. We need to have each client in its own partition: <br />
<br />
CREATE TABLE `mydb`.`test` (<br />
  `client_id` INT NOT NULL,<br />
  `client_name` VARCHAR(45) NULL,<br />
  PRIMARY KEY (`client_id`));<br />
<br />
ALTER TABLE test PARTITION BY LIST (client_id) <br />
(partition p100 values in (100),<br />
partition p101 values in (101));<br />
<br />
<br />
I am trying to create a stored procedure to be called when a new client is created:<br />
<br />
<br />
DELIMITER $$<br />
USE `mydb`$$<br />
CREATE PROCEDURE `util_partioning_partition_new`(IN p_client_id INT)<br />
BEGIN<br />
DECLARE partition_name varchar(25);<br />
select CONCAT(&#039;p&#039;, p_client_id) into partition_name;<br />
ALTER TABLE test ADD PARTITION  (PARTITION partition_name values in (p_client_id));<br />
END$$<br />
<br />
DELIMITER ;<br />
;<br />
<br />
and getting this error:<br />
Apply changes to util_partioning_partition_new	Error 1064: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed near &#039;p_client_id)); <br />
<br />
PLEASE HELP! How do I pass client ID to the values in()?<br />
<br />
Many thanks in advance,]]></description>
            <dc:creator>M Z</dc:creator>
            <category>Partitioning</category>
            <pubDate>Thu, 10 Sep 2020 01:26:54 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?106,689731,689731#msg-689731</guid>
            <title>Help to alter a non partitioned table to partitioned with subpartitions (no replies)</title>
            <link>https://forums.mysql.com/read.php?106,689731,689731#msg-689731</link>
            <description><![CDATA[ Hi,<br />
<br />
I have a table in my MySQL 5.7 database:<br />
<br />
create table CUSTOMERS<br />
(<br />
   CUSTOMER_ID bigint not null,<br />
   SERVICE_ID bigint not null,<br />
   POLICY_ID   bigint,<br />
   CUSTOMER_NAME        varchar(255),<br />
   CREATED_ON          datetime(6) not null,<br />
   primary key (CUSTOMER_ID),<br />
   unique key A_U1 (SERVICE_ID, CUSTOMER_NAME)<br />
);<br />
<br />
create index C_2 on CUSTOMERS<br />
(<br />
   POLICY_ID<br />
);<br />
<br />
I&#039;m looking for help to create the statements on how to change this table to be a partitioned table by list SERVICE_ID first and subpartitioned by CREATED_ON<br />
<br />
SERVICE_ID can be one of the following numbers: 01, 02, 03, 04, 05, 06, 07, 08, 09<br />
CREATED_DTM is a timestamp and I want the subpartitions to be daily based.<br />
<br />
Please also let me know if I need to upgrade to MySQL 8.0 to get access to better features to do this.<br />
<br />
Thanks in advance!]]></description>
            <dc:creator>O C</dc:creator>
            <category>Partitioning</category>
            <pubDate>Fri, 28 Aug 2020 11:04:04 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?106,687791,687791#msg-687791</guid>
            <title>Automate MySQL Partitioning using events and procedures (no replies)</title>
            <link>https://forums.mysql.com/read.php?106,687791,687791#msg-687791</link>
            <description><![CDATA[ Automate MySQL Partitioning using events and procedures <br />
- <a href="http://mysql-nordic.blogspot.com/2020/05/automate-mysql-partitioning-using.html"  rel="nofollow">http://mysql-nordic.blogspot.com/2020/05/automate-mysql-partitioning-using.html</a>]]></description>
            <dc:creator>Edwin Desouza</dc:creator>
            <category>Partitioning</category>
            <pubDate>Wed, 20 May 2020 15:10:05 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?106,685172,685172#msg-685172</guid>
            <title>Error &#039;Unknown error 1507&#039; on query. Query: &#039;ALTER TABLE x DROP PARTITION x&#039; (no replies)</title>
            <link>https://forums.mysql.com/read.php?106,685172,685172#msg-685172</link>
            <description><![CDATA[ I am having a problem on a newly setup slave database every day I get replication error Unknown error 1507&#039; on query. Query: &#039;ALTER TABLE x DROP PARTITION x&#039;. <br />
<br />
They all relate to partitions and does not seem to exist. So far I have been skipping the error however I am not certain if this is the correct way as the error keeps coming back. I believe there is a stored procedure or something on the master that prunes the partitions this is likely why it occurs daily. <br />
<br />
Having said that this is a slave db from a slave db. The middle slave that is slaving directly from the master does not have this behaviour.  Any suggestions, recommendations would be appreciated.]]></description>
            <dc:creator>Kevin Crous</dc:creator>
            <category>Partitioning</category>
            <pubDate>Thu, 19 Mar 2020 10:01:51 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?106,685125,685125#msg-685125</guid>
            <title>MySQL Partitioning based on ID and Week (no replies)</title>
            <link>https://forums.mysql.com/read.php?106,685125,685125#msg-685125</link>
            <description><![CDATA[ Hi! I have a table<br />
<br />
CREATE TABLE `acme`.`partitioned_table` (<br />
  `id` INT NULL,<br />
  `client_id` INT NOT NULL,<br />
  `create_datetime` INT NOT NULL,<br />
  `some_val` VARCHAR(45) NULL);<br />
<br />
I&#039;d like to partition this table in such a way that each client’s data is stored in its own partition based on the client_id AND each partition can only contain data for 1 week based on the create_datetime. This is done so we can drop weekly one week’s worth of data based each client’s own retention policy.<br />
<br />
For example, some clients would like to have 3 months of data while others may have longer data retention policies.<br />
<br />
I am having a hard time being new to MySQL to come up with a proper partitioning strategy. How can I partition by Week based on the INT column? To throw a curve ball this might be hosted on AWS RDS later.<br />
<br />
Many thanks in advance,<br />
<br />
M]]></description>
            <dc:creator>M Z</dc:creator>
            <category>Partitioning</category>
            <pubDate>Mon, 16 Mar 2020 17:14:22 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?106,683972,683972#msg-683972</guid>
            <title>Help with partition strategy (2 replies)</title>
            <link>https://forums.mysql.com/read.php?106,683972,683972#msg-683972</link>
            <description><![CDATA[ Hi everyone!<br />
<br />
I&#039;m trying to find out what would be the best partition strategy for a table that has millions of rows. The relevant columns are<br />
<br />
* date<br />
* userid<br />
* key<br />
* value<br />
<br />
Ke-values are received every X min from sensors, and there are N key-value pairs per user. (meaning, every time data is received, it gets more than 1 key-value pair per user).<br />
<br />
The table grows big very fast, but most users only need to access the last month(or year) of data (to generate charts and stats). However, I need to keep all data available for people who want to see historic data.<br />
<br />
My first thought was to partition based on userid first and date second (using a range rule to split the partitions).<br />
<br />
My other option was to actually have a scheduled event to move older rows (&gt;2years) to an &quot;archive&quot; table. Both the current and archive table would be partitioned based on userid only.<br />
<br />
What would be the preferred strategy here? Any other valuable tips? Is it worth to actually simulate both scenarios and see which performs better?<br />
<br />
thanks in advance]]></description>
            <dc:creator>Nuno Donato</dc:creator>
            <category>Partitioning</category>
            <pubDate>Tue, 28 Jan 2020 16:12:06 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?106,683490,683490#msg-683490</guid>
            <title>Adding partition taking time (1 reply)</title>
            <link>https://forums.mysql.com/read.php?106,683490,683490#msg-683490</link>
            <description><![CDATA[ in MySQL version 5.7 community server, Adding partition is taking nearly 30 mins.<br />
<br />
what could be the issue. how to trace or find the root cause]]></description>
            <dc:creator>Ragesh Kandathil</dc:creator>
            <category>Partitioning</category>
            <pubDate>Fri, 10 Jan 2020 13:25:50 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?106,682932,682932#msg-682932</guid>
            <title>Why Partition a table on a SAN (no replies)</title>
            <link>https://forums.mysql.com/read.php?106,682932,682932#msg-682932</link>
            <description><![CDATA[ How does the engine benefit if I partition a table on a SAN. <br />
<br />
Assuming i currently have 1 drive letter on a LUN across multiple drives.<br />
<br />
I then ask my SAN admin for 3 more drives with an effort to break up my table into 4 drives. <br />
<br />
He proceeds to add 3 more luns/Disk  across the same set of disks how does it benefit the table? <br />
<br />
It seems of the End user adds a where clause on the date it would be the same as not breaking up the table? what am I missing.<br />
<br />
Thanks]]></description>
            <dc:creator>doug valdez</dc:creator>
            <category>Partitioning</category>
            <pubDate>Mon, 16 Dec 2019 23:08:52 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?106,678783,678783#msg-678783</guid>
            <title>MySQL 5.5 - can&#039;t discard tablespace for partitioned tables? (no replies)</title>
            <link>https://forums.mysql.com/read.php?106,678783,678783#msg-678783</link>
            <description><![CDATA[ I have to restore a partitioned table from an old MySQL 5.5 backup, created with Percona&#039;s innobackupex. I have tried to import it into a newer version, but it fails due to incompatibilities around temporal data, so I have to use MySQL 5.5. The strategy involves:<br />
<br />
- create the table from information in the .frm file<br />
- discard the tablespace<br />
- move the backup tablespace to the data directory<br />
- import tablespace<br />
<br />
However, when I try to discard the tablespace, I get an error:<br />
<br />
ERROR 1031 (HY000) at line 1: Table storage engine for &#039;my_partitioned_table&#039; doesn&#039;t have this option<br />
<br />
I am sure I have done this before, but quite possibly in a more up-to-date version; is this not possible in MySQL 5.5?]]></description>
            <dc:creator>Jan Andersen</dc:creator>
            <category>Partitioning</category>
            <pubDate>Fri, 25 Oct 2019 08:34:28 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?106,675782,675782#msg-675782</guid>
            <title>Maintaining indexes with exchange partition (no replies)</title>
            <link>https://forums.mysql.com/read.php?106,675782,675782#msg-675782</link>
            <description><![CDATA[ We have a requirement to have a table partitioned by month to allow us to use exchange partition to swap in updated partitions on a regular basis. I want to understand how indexes are maintained on other columns in this scenario. When exchange partition is ran it will swap in the new data. I believe this is a simple file system operation of moving the new data in. How and when is the indexes updated? Or does it just retain the index data from the source table?]]></description>
            <dc:creator>Andrew Edwards</dc:creator>
            <category>Partitioning</category>
            <pubDate>Tue, 25 Jun 2019 11:04:39 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?106,674963,674963#msg-674963</guid>
            <title>error Code 1441:datetime function: datetime field overflow (no replies)</title>
            <link>https://forums.mysql.com/read.php?106,674963,674963#msg-674963</link>
            <description><![CDATA[ I am using version 5.6.44 with Tripwire Log centre. The TLC stopped sending data to the DB, the logs show an error stating that a partition could not be found.  I was advised to use the  CALL ADDPARTITION(737548) in a the MySQL command line, I did but saw no error.  When I used MySQL WorkBench and looked at the partitions it was not there.  I then ran the same command in WorkBench and I see the output error Code 1441:datetime function: datetime field overflow <br />
<br />
Does anyone have a clue?]]></description>
            <dc:creator>MEL Support</dc:creator>
            <category>Partitioning</category>
            <pubDate>Fri, 17 May 2019 08:20:30 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?106,673470,673470#msg-673470</guid>
            <title>Adding Subpartitions, help needed (no replies)</title>
            <link>https://forums.mysql.com/read.php?106,673470,673470#msg-673470</link>
            <description><![CDATA[ Hello,<br />
<br />
I have a tables called sales and I have created 12 (LIST) partititions for each of the business unit (id).<br />
<br />
Now I want to add subpartitions on each of those partitions based on the year by using YEAR(report_date).<br />
<br />
Below is the syntax I am trying<br />
<br />
ALTER TABLE sales<br />
MODIFY PARTITION sales_bu_p1 <br />
SUBPARTITION BY LIST (YEAR(report_date))<br />
SUBPARTITIONS 4 ( <br />
PARTITION p2017 VALUES IN (2017), <br />
PARTITION p2018 VALUES IN (2018), <br />
PARTITION p2019 VALUES IN (2019),<br />
PARTITION p2020 VALUES IN (2020)<br />
); <br />
<br />
But it is giving error (You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use)<br />
<br />
Please help me in correting the syntax if anything is wrong.<br />
<br />
Thanks in advance.<br />
<br />
Regards<br />
Pandit.P]]></description>
            <dc:creator>Pandit P</dc:creator>
            <category>Partitioning</category>
            <pubDate>Tue, 19 Mar 2019 07:21:33 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?106,672803,672803#msg-672803</guid>
            <title>Partition Plugin Not Found (2 replies)</title>
            <link>https://forums.mysql.com/read.php?106,672803,672803#msg-672803</link>
            <description><![CDATA[ I am running MySQL Community 8.0.15. When I run the command:<br />
<br />
Select * From Information_schema.plugins;<br />
<br />
...the plugin name &quot;partition&quot; does not appear on the list.<br />
<br />
I&#039;m running MySQL Community 5.6 on another server. It appears on that server.<br />
<br />
How do I make it appear on my 8.0.15 instance? Is it possible? What do I not know?<br />
<br />
Thank you in advance!]]></description>
            <dc:creator>Luke Lang</dc:creator>
            <category>Partitioning</category>
            <pubDate>Fri, 15 Feb 2019 14:32:21 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?106,669305,669305#msg-669305</guid>
            <title>Partitioned table maintenance (no replies)</title>
            <link>https://forums.mysql.com/read.php?106,669305,669305#msg-669305</link>
            <description><![CDATA[ Hi, <br />
<br />
I have these two maintenance scripts scheduled to run daily / weekly. <br />
<br />
&lt;code&gt; <br />
<br />
--Daily (except Sunday) <br />
mysqlcheck --user=root --password=&#039;*******&#039; --fast --auto-repair --optimize --force --silent --skip-write-binlog --databases testdatabase &gt; /root/DBSCRIPTS/Maintenance_Daily.log <br />
<br />
-- Weekly (only on Sunday) <br />
mysqlcheck --user=root --password=&#039;*******&#039; --quick --auto-repair --optimize --force --silent --skip-write-binlog --databases testdatabase &gt; /root/DBSCRIPTS/Maintenance_Weekly.log <br />
<br />
&lt;/code&gt; <br />
<br />
Recently I have created partitions of two tables which has 5 millions of data in each table and it is expected to grow by 1 million records every quarter. <br />
<br />
So far there is no plan to archive the old data. <br />
<br />
I have few questions. <br />
<br />
1. Is the above maintenance mysqlcheck script able to take care of optimizing the partitions/ <br />
<br />
2. If yes, will it be able to optimize the table even when the table size grows with billions of records? <br />
<br />
3. If I need to separate the maintenance script only for the partitioned tables, how can I do it with mysqlcheck command? <br />
<br />
4. If I skip &quot;--auto-repair --optimize&quot; and add only the optimize partitition(partition_name), it is not going to rebuild the indexes or defragment the data for the whole table. <br />
<br />
<br />
Please help. <br />
<br />
Thanks<br />
Praveen]]></description>
            <dc:creator>Pandit P</dc:creator>
            <category>Partitioning</category>
            <pubDate>Mon, 01 Oct 2018 12:09:36 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?106,669087,669087#msg-669087</guid>
            <title>partitioning and compression efficiency (no replies)</title>
            <link>https://forums.mysql.com/read.php?106,669087,669087#msg-669087</link>
            <description><![CDATA[ Hello,<br />
<br />
When I compress a table that is partitioned by linear hash, I get a substantial benefit, size ratio is 3.63. When I alter the table to partition it by key (which is what we prefer in this case) the benefit drops to a negligible ratio 1.17. <br />
<br />
Is there an explanation for this? <br />
<br />
Thanks,<br />
George]]></description>
            <dc:creator>George Develekos</dc:creator>
            <category>Partitioning</category>
            <pubDate>Thu, 20 Sep 2018 13:22:20 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?106,667444,667444#msg-667444</guid>
            <title>using window functions with &quot;partition by&quot; can give incorrect results (no replies)</title>
            <link>https://forums.mysql.com/read.php?106,667444,667444#msg-667444</link>
            <description><![CDATA[ I have a problem with window functions in MySQL8 - they give incorrect results when applied to large tables (either: large number of rows or large number of columns).<br />
<br />
Example: Table: bureau.csv (1.7 mln rows) from <a href="https://www.kaggle.com/c/home-credit-default-risk/data"  rel="nofollow">https://www.kaggle.com/c/home-credit-default-risk/data</a><br />
<br />
I run 3 simple queries changing only the number of rows of the table to be used and number of columns to be outputed. You can clearly see that the combination of large amount of rows and many outputed columns gives incorrect results of &quot;count(*) over()&quot; - the last column.<br />
<br />
More: <a href="https://stackoverflow.com/questions/51161778/mysql-8-window-function-wrong-results"  rel="nofollow">https://stackoverflow.com/questions/51161778/mysql-8-window-function-wrong-results</a>]]></description>
            <dc:creator>Witek Oleksiewicz</dc:creator>
            <category>Partitioning</category>
            <pubDate>Tue, 03 Jul 2018 20:42:59 +0000</pubDate>
        </item>
        <item>
            <guid>https://forums.mysql.com/read.php?106,667082,667082#msg-667082</guid>
            <title>how we can delete old data from hash partition ?? (no replies)</title>
            <link>https://forums.mysql.com/read.php?106,667082,667082#msg-667082</link>
            <description><![CDATA[ I want to keep 2 years old data into below table, older data I want to move to archival tables...<br />
<br />
<br />
I have one table with autoincrement id and daily 1 lakh records would be added into it.<br />
but its huge table so it will take more time with help of delete query.<br />
 <br />
I have created a HASH partition on it with 24 partitions. <br />
<br />
now daily or monthly I need to remove older than 2 years data from it, but its huge table so it will take more time with help of delete query.<br />
<br />
can we delete partition like range or list so we can delete old partition and old data will be deleted from the table?<br />
<br />
Please suggest how we can delete data ??]]></description>
            <dc:creator>sabbirali kadiwala</dc:creator>
            <category>Partitioning</category>
            <pubDate>Tue, 19 Jun 2018 10:07:55 +0000</pubDate>
        </item>
    </channel>
</rss>
