# Changing the table creation time on Historical data tables

**URL:** <https://forum.inductiveautomation.com/t/changing-the-table-creation-time-on-historical-data-tables/28039>\
**Category:** Ignition\
**Created:** [September 5, 2019, 1:47pm UTC](https://forum.inductiveautomation.com/t/changing-the-table-creation-time-on-historical-data-tables/28039 "2019-09-05T13:47:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anwesha\_Gupta](https://avatars.discourse-cdn.com/v4/letter/a/53a042/32.png) [@Anwesha\_Gupta](https://forum.inductiveautomation.com/u/Anwesha_Gupta)\
**Post date:** [September 5, 2019, 1:47pm UTC](https://forum.inductiveautomation.com/t/changing-the-table-creation-time-on-historical-data-tables/28039/1 "2019-09-05T13:47:07Z")

</div>

Hi All,

I changed the partitioning of the Historical tables from monthly to daily and I see that since I changed it around 10.20, Everyday the tables are created at the same time.

 ![Table%20Creation%20time](https://us1.discourse-cdn.com/inductiveautomation/original/2X/6/66fbc5092e56ff7493e887515a2ff5675abe9d5c.png)

When the initial data base was created, the partitioning was 1 month and the tables were created at 00.00 hrs.

But since the change over its created at 10.20 each day.

I was wondering if there is a way to get the tables to be created at 12 o clock each night so that each table has the data stored from when the day starts?

Regards

---

<div class="post-metadata">

**Author:** ![Connor\_Sims](https://avatars.discourse-cdn.com/v4/letter/c/c77e96/32.png) [@Connor\_Sims](https://forum.inductiveautomation.com/u/Connor_Sims)\
**Post date:** [November 27, 2023, 5:22pm UTC](https://forum.inductiveautomation.com/t/changing-the-table-creation-time-on-historical-data-tables/28039/2 "2023-11-27T17:22:33Z")

</div>

I'm wondering this same thing

---

<div class="post-metadata">

**Author:** ![Connor\_Sims](https://avatars.discourse-cdn.com/v4/letter/c/c77e96/32.png) [@Connor\_Sims](https://forum.inductiveautomation.com/u/Connor_Sims)\
**Post date:** [December 5, 2023, 3:43pm UTC](https://forum.inductiveautomation.com/t/changing-the-table-creation-time-on-historical-data-tables/28039/3 "2023-12-05T15:43:32Z")

</div>

I received a response from IA that manages this. It involves modifying the sqlth\_partitions table directly, & should be done with caution. IA explained to me that when a partition window passes, a new partition will only be created when there is a new data point, so the next day partition will not start exactly at 00.00 unless a tag is created 'exactly' then.

During the day, I modified the 'end\_time' column in the sqlth\_partitions table to midnight, & the partitions are roughly reset. After a few days of being set exactly at midnight, the partitions now start/end a couple seconds after midnight, which is fine for us.

I imagine you could have a script update the end\_time column each morning to midnight if you needed it close to/exactly 00.00 every day:

```auto
UPDATE sqlth_partitions sp
SET end_time = 1701410400000
where sp.start_time = (SELECT MAX(start_time) FROM sqlth_partitions sp2 )

```
