I create a java desktop app which communicates with a server for getting data from mysql.
Currently this query on server:
select
ec_transactions.added,
ec_transactions.merchant_id,
---
ec_customer_billing_details.card_payment_method,
---
ec_customer_details.first_name,
---
ec_customer_card_details.card_holde r_name,
---
from
ec_transactions,
ec_customer_billing_details,
ec_customer_details,
ec_customer_card_details
where ec_transactions.transactions_id = tranId
AND ec_customer_billing_details.customer_id = custId
AND ec_customer_details.customer_id = custId
AND ec_customer_card_details.customer_id = custId
is too slow.
How can i do it faster?
You can check this using the explain plan and setting indixes if not set on you tables, besides you can optimize your query, take a look at MySql documentation regarding optimizing statements.