Subject | Re: [firebird-support] Re: CONTAINING in SELECT statement and indexes |
---|---|
Author | Helen Borrie |
Post date | 2007-12-02T20:25:47Z |
At 02:25 AM 3/12/2007, you wrote:
But for name searches, where your search keys are going to be on the first characters of the first name or last name, you don't need keywords. You would store two indexed columns: "First names" and "Last Name" plus (if you need it) a computed field for "Full Name". Then your searches would be on one or both of the indexed fields.
create table blah (
...,
first_name varchar(60),
last_name varchar(60),
.....
full_name computed by (last_name || ', ' || first_names),
... )
(or whatever combination suits).
Note, it is not essential to store the full name at all, since you can select the full name in any query by concatenating the first names and last name elements to output a derived field. This is often a better option, in case your applications need a variety of full name formats.
./heLen
>With regards to my question, I do use the alternative you have justNo, it is altogether different.
>mentioned, but for huge amounts of text. The solution I was looking
>for is more for short strings such as fullName of an individual. Then,
>I may want to find all the people that have the name in the beginning,
>middle or end of the string. But I guess the solution would be to
>split the full name into first, middle and last, as well as have the
>column that stores the combination of the three. Then, index the
>first, middle, and last, and search on that. That more or less is what
>you have described, right?
But for name searches, where your search keys are going to be on the first characters of the first name or last name, you don't need keywords. You would store two indexed columns: "First names" and "Last Name" plus (if you need it) a computed field for "Full Name". Then your searches would be on one or both of the indexed fields.
create table blah (
...,
first_name varchar(60),
last_name varchar(60),
.....
full_name computed by (last_name || ', ' || first_names),
... )
(or whatever combination suits).
Note, it is not essential to store the full name at all, since you can select the full name in any query by concatenating the first names and last name elements to output a derived field. This is often a better option, in case your applications need a variety of full name formats.
./heLen