mariaDB Limit Issue

You are viewing an old version of this article. View the current version here.

We I run the below query on mariaDB 5.6 With the "LIMIT 100000" query get results in approximately 0.14s and when we remove the limit results will be around 1 minute but when we run the same query with or without limit on mysql 5.6 results will be in 0.12s, Kindly provide better way around why miaraDB engine has such a issue or may be our query has something to change.

EXPLAIN SELECT DISTINCT am.* FROM asset_make am, ( SELECT DISTINCT amg.asset_make_id FROM asset_model_groups amg, ( SELECT amgf.make_model_group_id FROM asset_model_groups_fp amgf, ( SELECT fp.financial_product_id_pk FROM financial_product fp, ( SELECT fpb.financial_product_id FROM financial_product_bps fpb, ( SELECT usr.relative_user_id FROM user_relationships usr, ( SELECT ud.user_bp_id FROM user_definition ud WHERE ud.user_id = 'd75502' ) AS ud WHERE usr. CODE = '00112' AND usr.userDefinition_user_id = ud.user_bp_id ) AS usr WHERE fpb.business_partner_id = usr.relative_user_id AND fpb.role_id = '00001' ) AS fpb WHERE fp.financial_product_id_pk = fpb.financial_product_id AND DATE( FROM_UNIXTIME(fp.valid_to_date / 1000) ) >= DATE(NOW())

LIMIT 100000 ) AS fp

WHERE amgf.financial_product_id = fp.financial_product_id_pk ) AS amgf WHERE amg.make_model_group_id = amgf.make_model_group_id ) AS amg WHERE am.make_id_pk = amg.asset_make_id

Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.