When i test
select * from myFederatedTable
(for test there is 50k rows) it take 0.3732 seconds
now I have two federated tables with data < 20000 in both tables, and have query like :
SELECT i.id_news, i.id_news_type, i.id_agency, i.add_date, i.update_date, j.title, k.image_name_latin, m.folder_path
FROM tbl i
INNER JOIN tbl_languages j on i.id_news = j.id_news and j.lang = 'en'
INNER JOIN federated_Table1 k on i.id_image_groups = k.id_image_groups
INNER JOIN federated_table2 m on k.id_folder_groups = m.id_folder_groups
ORDER BY i.update_date DESC
LIMIT 14
It takes 16 seconds
Without joins to federated tables
SELECT i.id_news, i.id_news_type, i.id_agency, i.add_date, i.update_date, j.title
FROM tbl i
INNER JOIN tbl_languages j on i.id_news = j.id_news and j.lang = 'en'
ORDER BY i.update_date DESC
LIMIT 14
0.0496 seconds.
I have few questions
- 1.Is there any way to optimize it ?
- 2.when i select from federated table (really i select from main database?) or when i join to federated table I really join to main database?
- 3.Task is copy data from one database tables to another database tables. Is there best way to replicate this 2 tables for quick
selection ?
Asked by GeoVIP
(263 rep)
Oct 29, 2014, 07:40 PM
Last activity: Sep 14, 2018, 10:28 AM
Last activity: Sep 14, 2018, 10:28 AM