I have a database that contains 2014,2015 and 2016’s worth of data broken down 
by year and quarter. In total, this db was 2.36 GB. Because of a replication 
requirement where the DB has to be under 2 GB, I’ve split the DB into 3 smaller 
databases by year (2014.db,2015.db,2016.db).

I would need to access at most two databases in one query for a year over year 
calculation over 6 quarters. Do I have the same performance as having one table 
with all the data if I write my sql this way?

Attach 2014.db as 2014
Attach 2015.db as 2015

(..Calculation..) FROM (SELECT * FROM 2014.datatable  UNION ALL SELECT * FROM 
2015.datatable)

You can assume the separate databases have the same indexing as the single db, 
where it’s indexed by year and quarter.

Thanks,
Michael
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to