At the mysql query of a large table (1 million records) with dual sorting and limit, there are lost some records. For example:
SELECT rec.id, rec.Price, rec.RegionName, rec.isPayed, rec.isTop
FROM Records rec
LEFT JOIN Region reg ON reg.RegionID = rec.RegionID
WHERE rec.Type = "Apartment" AND rec.Transaction = "Sale" AND rec.IsPublished = 1
ORDER BY rec.isTop DESC, rec.Price ASC
LIMIT 160, 20
I see the solution only through the union ... but maybe you know better solution?
Thanks!