Прогнал все три запроса по два раза в IBExpert.
Firebird 1.0.2.
Записей в основной таблице > 1100000, во второй ~ 350000.
Вот результаты:
nikotano
Цитата:
------ Performance info ------
Prepare time = 0ms
Execute time = 1m 5s 765ms
Avg fetch time = 0,06 ms
Current memory = 13 186 048
Max memory = 13 320 296
Memory buffers = 10 000
Reads from disk to cache = 184 898
Writes from cache to disk = 0
Fetches from cache = 4 525 077
------ Performance info ------
Prepare time = 15ms
Execute time = 45s 375ms
Avg fetch time = 0,04 ms
Current memory = 13 186 048
Max memory = 13 325 416
Memory buffers = 10 000
Reads from disk to cache = 184 898
Writes from cache to disk = 0
Fetches from cache = 4 525 077
|
_Lynx_
Цитата:
------ Performance info ------
Prepare time = 16ms
Execute time = 50s 937ms
Avg fetch time = 0,04 ms
Current memory = 13 178 880
Max memory = 13 325 416
Memory buffers = 10 000
Reads from disk to cache = 175 366
Writes from cache to disk = 6
Fetches from cache = 9 622 151
------ Performance info ------
Prepare time = 0ms
Execute time = 1m 11s 766ms
Avg fetch time = 0,06 ms
Current memory = 13 178 880
Max memory = 13 325 416
Memory buffers = 10 000
Reads from disk to cache = 175 366
Writes from cache to disk = 6
Fetches from cache = 9 622 151
|
EvroStandart
Цитата:
------ Performance info ------
Prepare time = 0ms
Execute time = 1m 6s 875ms
Avg fetch time = 0,06 ms
Current memory = 13 177 856
Max memory = 13 325 416
Memory buffers = 10 000
Reads from disk to cache = 175 271
Writes from cache to disk = 0
Fetches from cache = 9 621 045
------ Performance info ------
Prepare time = 16ms
Execute time = 46s 297ms
Avg fetch time = 0,04 ms
Current memory = 13 177 856
Max memory = 13 325 416
Memory buffers = 10 000
Reads from disk to cache = 175 271
Writes from cache to disk = 0
Fetches from cache = 9 621 045
|
Система:
Windows XP Prof
Intel P4 2.4 GHz, 512RAM.
Цитата:
kogan:
Но н-р, если не указывать професию (тоесть поставить Null) у юзера, то запрос EvroStandart его выберет, а nikotano - нет.
|
Это решается при помощи внешнего ключа.