Skip to content
Advertisement

Process daily tables in laravel

I am making a laravel based system that going to save millions of records in a single table daily. to overcome this issue i came up with an idea to save data to daily identical tables. (note table structure is the same)

Ex: table_20200501, table_20200502, table_20200503

now the issue is when i am querying the data. if someone search data between 2020-05-01 and 2020-05-02 how do i connect those two tables and return data without writing raw queries (not using a model). also i am using datatable server site processing as well.

it would be a big help if someone can help this. thanks in advance.

Advertisement

Answer

That sounds like you need a Union query, Laravel does provide functionality for Unions: Docs for Union Queries

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement