Massive slowdowns due to SHOW TABLES and SHOW FULL COLUMNS
Posted: 13.02.2014, 13:49
Hello,
please pardon my utter ignorance about the inner mechanics of your beautiful library.
I have developed a massively large and complex Delphi XE5 application that acts as "glue" between etherogeneous remote front end and MySQL 5 back ends.
So far it's working pretty well but it's slow, very slow. In fact I have to insert and delete records more than I'd like (but the back end demands that) and that's a factor.
But there's another. Everywhere in my queries, ZEOS puts in some "SHOW TABLES" and "SHOW FULL COLUMNS". The applications work across internet and no, I cannot make it 3 tiers DataSnap.
I am attaching a snippet of the typical queries generated per every master-detail record:
While I can't really cut out some slow stuff going on here, I'd really love to be able and skip all those SHOW commands operating on tables containing lots of fields. I am expecially vary of the 'LIKE %' bits.
Is there a way to do that? What are the downsides? I do need to show the data through ClientDataSets but I am specifying all the fields one by one (that is, I don't send "SELECT *" queries that require metadata discovery).
If you need further information or details I'll gladly provide them.
Thanks in advance.
please pardon my utter ignorance about the inner mechanics of your beautiful library.
I have developed a massively large and complex Delphi XE5 application that acts as "glue" between etherogeneous remote front end and MySQL 5 back ends.
So far it's working pretty well but it's slow, very slow. In fact I have to insert and delete records more than I'd like (but the back end demands that) and that's a factor.
But there's another. Everywhere in my queries, ZEOS puts in some "SHOW TABLES" and "SHOW FULL COLUMNS". The applications work across internet and no, I cannot make it 3 tiers DataSnap.
I am attaching a snippet of the typical queries generated per every master-detail record:
Code: Select all
2014-02-13 12:30:14 cat: Execute, proto: mysql-5, msg: Native SetAutoCommit Falsecall
2014-02-13 12:30:14 cat: Execute, proto: mysql-5, msg: Statement 80 : SELECT product_id, geo_zone_id FROM fw_product_to_geozone WHERE product_id = 68 AND geo_zone_id = 14
2014-02-13 12:30:15 cat: Execute, proto: mysql-5, msg: Statement 82 : INSERT INTO fw_product_to_geozone (product_id, geo_zone_id, date_added, date_modified, user_modified) VALUES (68, 14, '2014-02-13 12:30:15', '2014-02-13 12:30:15', 'dfuma_000')
2014-02-13 12:30:16 cat: Execute, proto: mysql-5, msg: Native Commit call
2014-02-13 12:30:16 cat: Execute, proto: mysql-5, msg: Native SetAutoCommit Truecall
2014-02-13 12:30:16 cat: Execute, proto: mysql-5, msg: Statement 84 : SELECT dz.delivery_zone_id AS delivery_zone_id, dz.geo_zone_id AS geo_zone_id, dz.status AS status, lc.name AS name FROM fw_delivery_zone dz LEFT JOIN fw_localized_country lc ON (dz.visual_country_id = lc.country_id AND lc.language_id = 2) ORDER BY lc.name
2014-02-13 12:30:16 cat: Execute, proto: mysql-5, msg: Statement 85 : SHOW TABLES FROM xc_7614s LIKE 'fw_delivery_zone'
2014-02-13 12:30:17 cat: Execute, proto: mysql-5, msg: Statement 86 : SHOW FULL COLUMNS FROM xc_7614s.fw_delivery_zone LIKE '%'
2014-02-13 12:30:17 cat: Execute, proto: mysql-5, msg: Statement 87 : SHOW TABLES FROM xc_7614s LIKE 'fw_localized_country'
2014-02-13 12:30:17 cat: Execute, proto: mysql-5, msg: Statement 88 : SHOW FULL COLUMNS FROM xc_7614s.fw_localized_country LIKE '%'
Is there a way to do that? What are the downsides? I do need to show the data through ClientDataSets but I am specifying all the fields one by one (that is, I don't send "SELECT *" queries that require metadata discovery).
If you need further information or details I'll gladly provide them.
Thanks in advance.