Subject | Re[4]: [firebird-support] Re: Using VIEW (or not) |
---|---|
Author | Nando Dessena |
Post date | 2003-11-25T14:14:07Z |
Riho-Rene,
RRE> OK, so the problem is not in view.
In fact it's in sorting time and time-to-first-record.
RRE> select distinct currency from v_stat_history where sdate between
RRE> '1.10.2003' and '3.10.2003' and accid=2 order by row
RRE> (9 sec)
Probably two sorts and one duplicate-eliminating pass
RRE> select currency from v_stat_history where sdate between '1.10.2003' and
RRE> '3.10.2003' and accid=2 order by row
RRE> (1.5 sec)
just one sort. See Helen's advice about indexes.
RRE> The statstics and PLAN are exactly the same. Why so big time difference?
Stats don't show sort time, do they?
Ciao
--
Nando mailto:nandod@...
RRE> OK, so the problem is not in view.
In fact it's in sorting time and time-to-first-record.
RRE> select distinct currency from v_stat_history where sdate between
RRE> '1.10.2003' and '3.10.2003' and accid=2 order by row
RRE> (9 sec)
Probably two sorts and one duplicate-eliminating pass
RRE> select currency from v_stat_history where sdate between '1.10.2003' and
RRE> '3.10.2003' and accid=2 order by row
RRE> (1.5 sec)
just one sort. See Helen's advice about indexes.
RRE> The statstics and PLAN are exactly the same. Why so big time difference?
Stats don't show sort time, do they?
Ciao
--
Nando mailto:nandod@...