php - Query every time keypress or a inital big query? Which is better in cakePHP and jquery? -


Hello, I have a site developed in the cakepap, I have an input type text in a page where a user creates a query to get the data to get the data "restriction" to get the string in which the string Is included (in the example: "banana", "restricted" ...). Every time the user takes the score of one more letter, I do another query to retrieve the data every time you argue the strat string. The query is made in jquery every time when a user presses a letter. For example, my table has a record of 1 million and I do not know if a user starts digitally, if this solution is fast. Another solution is: When I open that page, I ask a question to find all the records and keep them in the array. Every time a user marks a letter, I search for that string to get a sobre ray with the result.

Which is the best solution in terms of speed, RAM? Consider that I can have 1 million records in that table, and many users can log on to that page simultaneously. My database is MYSQL.

I just suggest that a simple search button is the easiest and saves your server for Most of the resources are there, but the tutorials are there, I think it can give you some ideas, to reduce the questions and to reduce the caching sounds as needed, a small letter 3-4 should be remembered as needed.

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -