chiwilliam / sfsuxmas

Automatically exported from code.google.com/p/sfsuxmas
0 stars 0 forks source link

Probe Search Autocomplete #4

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Following the implementation of probe search
(http://code.google.com/p/sfsuxmas/issues/detail?id=3), it would be nice to
offer autocomplete (also known as http://en.wikipedia.org/wiki/IntelliSense).

We have (or maybe had) something similar for checking whether a file name
exists already. Architecture should be as follows:

User begins typing - on entering the third letter, JS listener kicks off
AJAX request to search servlet, prepares for response. Servlet hits DB,
formats response (JSON?). JS is passed the response and presents it to the
user - could be as simple as a probe list using the standard probe renderer.

Performance wise, need to made sure we handle the user typing wildly and
melting the server, since subsequent letters will fire off additional
requests - a good request timeout/dropping solution could be used elsewhere
(PCAD integration for example)

Original issue reported on code.google.com by b.j.dalz...@gmail.com on 25 May 2009 at 3:52

GoogleCodeExporter commented 9 years ago
For the Autocomplete, I would like to discuss with you the possibility to use 
the
Singleton structure for the probes tables and/or to index the table to avoid 
clogging
the server.

Tomorrow I will work on another project, which has the Autocomplete 
functionality.
There I use AJAX and an indexed database. I will play with it to gain some 
experience
about performance and I will get back to you.

Original comment by whemu...@gmail.com on 25 May 2009 at 6:12

GoogleCodeExporter commented 9 years ago
there is already an composite primary key index on the probe ID:

mysql> describe probes;
+----------+-------------+------+-----+---------+-------+
| Field    | Type        | Null | Key | Default | Extra |
+----------+-------------+------+-----+---------+-------+
| probe_id | varchar(50) | NO   | PRI | NULL    |       | 
| set_id   | int(11)     | NO   | PRI | NULL    |       | 
+----------+-------------+------+-----+---------+-------+
2 rows in set (0.01 sec)

I'm not sure how MySQL does its indexing, and whether an additional index would 
help?
We'd always be including the set_id in the query also

Original comment by b.j.dalz...@gmail.com on 25 May 2009 at 6:22