I have 6 tables. All of them can have millions and millions of lines of data. All of the tables have object_id, changer_id, date_created columns.
I need to make a query on all of the tables
AND date_created > dateA
AND dateCreated < dateB
or its grails equivalent
Same query will be made on all of the 6 tables, and then the results are combined and all duplicates are removed.
Im not using between because dateB might not always exist so it would be ommited.
Is there a way to combine this query into single query over 6 tables or any other way to make it faster than 6 separate queryes?