Subject | Re: [firebird-support] Speedy HTML list boxes |
---|---|
Author | Dennis Mulder |
Post date | 2005-10-27T12:01:41Z |
I think database performance shouldn't be an issue here.
The trick is to narrow down your selection list so that not all your
(potential) customers are displayed.
The problem with your solution, selecting the starting letter, is that
you have to know the exact name of the customer.
It's better to search for a substring in your customer list. If you have
a very big customer table, then it's better not to use "like '%substring%'".
This is costly in terms of performance. Better use "like 'substring%'".
So not a % at the beginning, otherwise you can't make use of the index
which slow things down considerably.
If you're searching for a substring when using "like 'substring%'",
you'll have to parse the customer name into separate words/strings and
put these substrings together with the customer id in another table.
This will then be your search table, with the substring column and the
customer id field as an aggregate primary key.
You can write a stored procedure that parses the customer name and
append the substrings and customer id in your search table when you
enter a new customer. Drop the doubles in your substrings. So "the
catcher in the rye company" will be "the catcher in rye company".
Usually there are other criteria you can use to narrow down your selection.
Eg., you can narrow down by country->state->region->city, ZIP-code or
customer id.
I hope this is an answer to your question.
Dennis
Daniel L. Miller wrote:
The trick is to narrow down your selection list so that not all your
(potential) customers are displayed.
The problem with your solution, selecting the starting letter, is that
you have to know the exact name of the customer.
It's better to search for a substring in your customer list. If you have
a very big customer table, then it's better not to use "like '%substring%'".
This is costly in terms of performance. Better use "like 'substring%'".
So not a % at the beginning, otherwise you can't make use of the index
which slow things down considerably.
If you're searching for a substring when using "like 'substring%'",
you'll have to parse the customer name into separate words/strings and
put these substrings together with the customer id in another table.
This will then be your search table, with the substring column and the
customer id field as an aggregate primary key.
You can write a stored procedure that parses the customer name and
append the substrings and customer id in your search table when you
enter a new customer. Drop the doubles in your substrings. So "the
catcher in the rye company" will be "the catcher in rye company".
Usually there are other criteria you can use to narrow down your selection.
Eg., you can narrow down by country->state->region->city, ZIP-code or
customer id.
I hope this is an answer to your question.
Dennis
Daniel L. Miller wrote:
> This may not be a completely Firebird question - but since I just
> browsed through some of the Firebird performance-related threads on the
> list I thought I'd ask here first.
>
> I'm developing a web-based project management/accounting system for
> internal use, using the core trio of Apache, PHP, and Firebird. Quite
> often, there will be times when the user will need to enter/select a
> value from an existing table, e.g. selecting from the customer list when
> entering a new project. Assume a decently configured table, with
> generator-based numeric primary keys, ascending/descending indexes,
> etc. As the customer table grows . . . both the selection time in the
> database as well as the simple page loading time is going to increase as
> well.
>
> Does anyone have suggestions on how I can speed this up? I've been
> considering something using Javascript, where the user would first pick
> from the starting letter(s), and then re-fill the list with the
> appropriate subgrouping. Any comments?
>
> Daniel
>
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Visit http://firebird.sourceforge.net and click the Resources item
> on the main (top) menu. Try Knowledgebase and FAQ links !
>
> Also search the knowledgebases at http://www.ibphoenix.com
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
>
>
>
> SPONSORED LINKS
> Technical support
> <http://groups.yahoo.com/gads?t=ms&k=Technical+support&w1=Technical+support&w2=Computer+technical+support&w3=Compaq+computer+technical+support&w4=Compaq+technical+support&w5=Hewlett+packard+technical+support&w6=Microsoft+technical+support&c=6&s=196&.sig=-XIO8GxY6hqd3NaD5WSEyw>
> Computer technical support
> <http://groups.yahoo.com/gads?t=ms&k=Computer+technical+support&w1=Technical+support&w2=Computer+technical+support&w3=Compaq+computer+technical+support&w4=Compaq+technical+support&w5=Hewlett+packard+technical+support&w6=Microsoft+technical+support&c=6&s=196&.sig=B29J78SYXnNTjjMFBMznqA>
> Compaq computer technical support
> <http://groups.yahoo.com/gads?t=ms&k=Compaq+computer+technical+support&w1=Technical+support&w2=Computer+technical+support&w3=Compaq+computer+technical+support&w4=Compaq+technical+support&w5=Hewlett+packard+technical+support&w6=Microsoft+technical+support&c=6&s=196&.sig=7_je1A94xs82CFXUjEqA6g>
>
> Compaq technical support
> <http://groups.yahoo.com/gads?t=ms&k=Compaq+technical+support&w1=Technical+support&w2=Computer+technical+support&w3=Compaq+computer+technical+support&w4=Compaq+technical+support&w5=Hewlett+packard+technical+support&w6=Microsoft+technical+support&c=6&s=196&.sig=2zMAuRCo5cJrVBr1Bxa3_w>
> Hewlett packard technical support
> <http://groups.yahoo.com/gads?t=ms&k=Hewlett+packard+technical+support&w1=Technical+support&w2=Computer+technical+support&w3=Compaq+computer+technical+support&w4=Compaq+technical+support&w5=Hewlett+packard+technical+support&w6=Microsoft+technical+support&c=6&s=196&.sig=_ytYU7aXb57AVaeUfmvLcA>
> Microsoft technical support
> <http://groups.yahoo.com/gads?t=ms&k=Microsoft+technical+support&w1=Technical+support&w2=Computer+technical+support&w3=Compaq+computer+technical+support&w4=Compaq+technical+support&w5=Hewlett+packard+technical+support&w6=Microsoft+technical+support&c=6&s=196&.sig=4hRo6NXYavRAbTkaYec5Lw>
>
>
>
> ------------------------------------------------------------------------
> YAHOO! GROUPS LINKS
>
> * Visit your group "firebird-support
> <http://groups.yahoo.com/group/firebird-support>" on the web.
>
> * To unsubscribe from this group, send an email to:
> firebird-support-unsubscribe@yahoogroups.com
> <mailto:firebird-support-unsubscribe@yahoogroups.com?subject=Unsubscribe>
>
> * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service <http://docs.yahoo.com/info/terms/>.
>
>
> ------------------------------------------------------------------------
>