Table Query:
Id Subject LangId replyCount created_at
Table userLogin:
Id userId Fname Lanme created_at
I am using select query with inner join to fetch data from mysql but it takes about 5sec to fetch 10000 records,I have also used indexing on coulmn LangId,Can you suggest any other way to make it run faster?
select q.id,q.Subject,u.userid,q.replyCount,DATE_FORMAT(q.created_at,'%d-%b-%Y')
from query as q INNER JOIN userLogin as u on q.userId = u.id where q.LangId = ?
Just do not select 10000 records at once.
To do a pagination, you have to run the same query on the every page with LIMIT clause, fetching the only records required on the page.