Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
Sounds like you may also have a problem with your database structure. A query that fetches 800 records from a table with only those 800 records in it should not take a full second - it should be mi...
Answer
#1: Initial revision
Sounds like you may also have a problem with your database structure. A query that fetches 800 records from a table with only those 800 records in it should not take a full second - it should be milliseconds. Make use of the `EXPLAIN` function to find out what your queries are trying to do and what indexes they're trying to use. ```sql SELECT property_id, property_capacity, property_rooms FROM properties WHERE property_status = 2 ``` This query should ideally be using an index for `property_status` to filter your records. Do you have an index on the `property_status` column? Go through each of the queries you're finding slow and identify whether you have appropriate indexes for it to use.