Сервер: 2 процессора AMD Opteron 2,66, 4Гб ОЗУ. ОС - Linux Fedora Core 8.0/
Оба FB стоят на одном сервере сервере с той лишь разницей, что 2.5 стоит в chroot-окружении и там же лежат базы для него.
1. Простое чтение из таблицы (Select * from "MyBase") - время почти не отличается
FB 2.1. | . FB 2.5
Prepare time = 360ms. | . Prepare time = 328ms
Execute time = 1m 8s 469ms. | . Execute time = 1m 9s 328ms
Avg fetch time = 0,45 ms. | . Avg fetch time = 0,45 ms
Current memory = 2 006 996. | . Current memory = 61 460 728
Max memory = 8 747 984. | . Max memory = 72 923 536
Memory buffers = 75. | . Memory buffers = 2 048
Reads from disk to cache = 3 238. | . Reads from disk to cache = 42 493
Writes from cache to disk = 0. | . Writes from cache to disk = 474
Fetches from cache = 343 527. | . Fetches from cache = 10 591 924
2. Сложный запрос (ниже пример)
Код: Выделить всё
select NP.ID, 'Клиент: '||NP."Alias"||' Значение: '||NP."Name"
from
"B_GetAP" NP --Используется View
left join "l_AC" AC on (((lastdaymonth(NP."DateStart")) = AC."StopDate") AND (NP."DateStart" = AC."StartDate") AND (NP."ID" = AC."AccountNo"))
left join "l_AG" AG on ((NP."GroupNo" = AG."ID"))
where
(abs(z(AC."ControlSum")) < abs(z((Case AG."AccountType"
when 'A' then (Select Sum(C."Summ") from "b_AgrC" C
left join "b_AgrS" S on (C."AgrSID" = S."ID") where (C."Date" between NP."DateStart" and (lastdaymonth(NP."DateStart"))) and
(S."KB" = NP."ID") and "Status" = 656)
else
(Select -Sum(C."Summ") from "b_AgrC" C
left join "b_AgrS" S on (C."AgrSID" = S."ID") where (C."Date" between NP."DateStart" and (lastdaymonth(NP."DateStart"))) and
(S."DB" = NP."ID") and "Status" = 656) end
))))
FB 2.1. | . FB 2.5
Prepare time = 359ms. | . Prepare time = 515ms
Execute time = 8s 391ms. | . Execute time = 52s 719ms
Current memory = 1 970 780. | . Current memory = 60 540 564
Max memory = 8 747 872. | . Max memory = 72 923 536
Memory buffers = 75. | . Memory buffers = 2 048
Reads from disk to cache = 395. | . Reads from disk to cache = 28 140
Writes from cache to disk = 0 . | . Writes from cache to disk = 157
Fetches from cache = 7 081 331. | . Fetches from cache = 0
Мы сейчас пытаемся разобраться почему так происходит и на каких запросах происходит замедление.
Подскажите, почему такое происходит. Предполагалось, что этот FB будет пусть незначительно, но быстрее. Может ли это быть из-за особенностей установки FB.
Если нужна какая-то дополнительная информация - пишите вопросы.