php + mysql - performance - instant auto complete response

autocomplete, joomla, mysql, performance, php

Solution

- Create indexes on some necessary sql fields.

- Use delay depending on the number of key pressed (and also, the time between 2 key pressed if you want).

- Add your own cache logic.

- LIMIT the result of the query

Problem

I'm building an autocomplete feature for an input box which is similar to Google's Instant Search. I need to have an instant response for the autocomplete feature. The table I'm executing the query with the term in it has hundreds of thousands of records and more that a hundred of columns. For example: 500,000 records, 120 columns. So, I have two issues: - Executing a query with the most possible speed. - Fast response on showing the result in search box's auto complete drop down. By the way, I'm using the Joomla framework which might cause some slow down, too.

Original source