I have a query that fetches data from two tables but it takes too much time to fetch data. The browser loads and shows nothing as a result. When I run this query in the MySQL database, it takes a long time to execute.
SELECT
*
FROM
library_new_item AS library
LEFT JOIN library_items_barcode AS boorcode ON library.lib_item_id=boorcode.lib_items_id
ORDER BY
library.lib_item_id ASC
LIMIT 100
Unless you post your DB structure, or share the Explain
output or the error message, it'd be impossible for us to answer. But if you want us to take a shot in the dark, this could possibly be the issue:
on library.lib_item_id = boorcode.lib_items_id