Hi developers I am researching ways of fast selecting rows from many tables with identical structure. Tables have too much data to be 1 table. So every table contains data for 1 month.
For example log_2011_01 ,log_2011_02 etc. Tables have datetime column created_at.
I need to create stored procedure , it must contain 2 datetime parameters for searching between this dates and few others.
Now I see next realization:
stored procedure must calculate collection of tables between 2 dates and generate sql to select data with union_all .
I think I will be to heavy and not ready for highload,isn’t it?
Is there are any other possibilities to do this?
Thanks
Agree with other comments, but I tried to help you with SP. This SP builds the query that can be executed with prepared statements.