Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 517 Vote(s) - 3.45 Average
  • 1
  • 2
  • 3
  • 4
  • 5
php + mysql - performance - instant auto complete response

#1
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:

1. Executing a query with the most possible speed.
2. 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.
Reply

#2
Use `Indexing` on Field which you want to show in autocomplete from your Database.

[To see links please register here]

Reply

#3
Auto-complete can be triggered when the user input is at-least 3 characters long.
Reply

#4
If possible consider to use a nosql database like Mongodb or Cassandra for this table as they are made for that kind of data, especially if the data will grow. To transport the data from the server to the client use json.
Reply

#5
1. Create indexes on some necessary sql fields.
2. Use delay depending on the number of key pressed (and also, the time between 2 key pressed if you want).
3. Add your own cache logic.
4. LIMIT the result of the query
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through