Is there is a better way to perform this query
select name, purchase_price from products where name='alisda' and purchase_price=1
query in MySQL is being executed too long, the table has 50m rows. What’s the best way to analyze and resolve the issue.
Are the columns you are constraining the query to, indexed? name and purchase_price ?
@umairparacha Check if you have the indexes in the same order than the conditions. That will help
@narcisonunez21 I just want to ask if there is some better way to write this query.
@jlrdw I am not quite familiar with binding parameters. Can you please explain how to bind parameters? Thanks
@jlrdw Thanks for helping out. what are the advantages of using parameters binding?
@umairparacha allows you to sanitise inputs which prevents SQL injection vulnerability
Please or to participate in this conversation.