Subject | Re: Query optimization |
---|---|
Author | Ali Gökçen |
Post date | 2005-10-07T09:57:46Z |
Hi,
here is some more suggestions for you and newbies who interested.
If MSISDN field is full-numeric(=not alphanumeric) then you should
use INTEGER instead of varchar(9). string fields need more bytes and
clockcycles for operations, increases costs, decreases performances.
then you can use "where MSISDN between 600000000 and 699999999".
Don't create any duplicate index, use unique compound index instead
of it. MSISDN+INTERACT_ID for example.
(not INTERACT_ID+MSISDN!; should be poors first).
create index on fields if you using them in where clause to search.
And, read documents about FB from www.ibphoenix.com
Regards.
Ali
--- In firebird-support@yahoogroups.com, "Diego Rodriguez"
<drodriguez@a...> wrote:
here is some more suggestions for you and newbies who interested.
If MSISDN field is full-numeric(=not alphanumeric) then you should
use INTEGER instead of varchar(9). string fields need more bytes and
clockcycles for operations, increases costs, decreases performances.
then you can use "where MSISDN between 600000000 and 699999999".
Don't create any duplicate index, use unique compound index instead
of it. MSISDN+INTERACT_ID for example.
(not INTERACT_ID+MSISDN!; should be poors first).
create index on fields if you using them in where clause to search.
And, read documents about FB from www.ibphoenix.com
Regards.
Ali
--- In firebird-support@yahoogroups.com, "Diego Rodriguez"
<drodriguez@a...> wrote:
>on 10
> Hi,
>
> Many thanks for your help. The query that took 3 hours now runs
> seconds. It was very useful your hint about indexes in the PLAN,because as
> only appeared one index, I didn't understand the use of declaringmore than
> one index in a table. Adding one more index has improved allqueries, not
> only this one, about 25%thread,
>
> I have one more question about indexes, but I will start a new
> because is not exactly related to this query
>
> Diego