am using MySQL database. When I execute a query which the main table(20 thousands of rows) is joined with the other 5 tables, it takes 90 seconds to return me the result. I then added indices into each of the criteria(where clause). Then the execution time drops from 90 seconds to 45 seconds and then I tried to select only necessary fields instead of all(*), it takes 25 seconds. What should I do to make it drop to less than 5 seconds or even one second?

Show us your query, show us your tables structure, including the indexes. Use the "EXPLAIN" command to see which indexes are actually used and which just sit there and wait. Which engine do you use?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.