You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following batch will generate script with list of 1500 literals for testing of performance of:
SELECT 1 FROM RDB$DATABASE WHERE :n IN ( <this_huge_list> ):
@echo off
setlocal enabledelayedexpansion enableextensions
set sql=inlist.sql
del %sql% 2>nul
set n=1500
echo show version;>>%sql%
echo set stat on;>>%sql%
echo select 1 from>>%sql%
echo rdb$database where %n% in(>>%sql%
set /a k=2147483647
set str=(
for /l %%i in (1, 1, %n%) do (
echo !k!
if .%%i.==.1. (
echo !k!>>%sql%
) else (
if .%%i.==.%n%. (
echo ,%n%>>%sql%
) else (
echo ,!k!>>%sql%
)
)
set /a k=!k!-1
)
echo );>>%sql%
(script can be taken also from attached .zip)
Results in 3.0 and old 2.5.0:
ISQL Version: WI-T3.0.0.31756 Firebird 3.0 Beta 2
Server version:
Firebird/Windows/Intel/i386 (access method), version "WI-T3.0.0.31756 Firebird 3.0 Beta 2"
Firebird/Windows/Intel/i386 (remote server), version "WI-T3.0.0.31756 Firebird 3.0 Beta 2/tcp (csprog)/P13"
Firebird/Windows/Intel/i386 (remote interface), version "WI-T3.0.0.31756 Firebird 3.0 Beta 2/tcp (csprog)/P13"
on disk structure version 12.0
ISQL Version: WI-V2.5.0.26074 Firebird 2.5
Server version:
Firebird/x86/Windows NT (access method), version "WI-V2.5.0.26074 Firebird 2.5"
Firebird/x86/Windows NT (remote server), version "WI-V2.5.0.26074 Firebird 2.5/tcp (csprog)/P12"
Firebird/x86/Windows NT (remote interface), version "WI-V2.5.0.26074 Firebird 2.5/tcp (csprog)/P12"
on disk structure version 11.2
PS. It seems that is is PARSER who works too slow: if I change the place of value 1500 (which is looked for) from the end to the beginning of list then time remains the same. I suppose that engine stops immediatelly when search found value, so this time should be reduced - but it was not so.
Submitted by: @pavel-zotov
Attachments:
inlist_1500_elements.zip
The following batch will generate script with list of 1500 literals for testing of performance of:
SELECT 1 FROM RDB$DATABASE WHERE :n IN ( <this_huge_list> ):
@echo off
setlocal enabledelayedexpansion enableextensions
set sql=inlist.sql
del %sql% 2>nul
set n=1500
echo show version;>>%sql%
echo set stat on;>>%sql%
echo select 1 from>>%sql%
echo rdb$database where %n% in(>>%sql%
set /a k=2147483647
set str=(
for /l %%i in (1, 1, %n%) do (
echo !k!
if .%%i.==.1. (
echo !k!>>%sql%
) else (
if .%%i.==.%n%. (
echo ,%n%>>%sql%
) else (
echo ,!k!>>%sql%
)
)
set /a k=!k!-1
)
echo );>>%sql%
(script can be taken also from attached .zip)
Results in 3.0 and old 2.5.0:
ISQL Version: WI-T3.0.0.31756 Firebird 3.0 Beta 2
Server version:
Firebird/Windows/Intel/i386 (access method), version "WI-T3.0.0.31756 Firebird 3.0 Beta 2"
Firebird/Windows/Intel/i386 (remote server), version "WI-T3.0.0.31756 Firebird 3.0 Beta 2/tcp (csprog)/P13"
Firebird/Windows/Intel/i386 (remote interface), version "WI-T3.0.0.31756 Firebird 3.0 Beta 2/tcp (csprog)/P13"
on disk structure version 12.0
============
1
Current memory = 94624048
Delta memory = 57537952
Max memory = 94692960
Elapsed time= 0.794 sec
Buffers = 8192
Reads = 1
Writes = 0
Fetches = 12
=== vs ===
ISQL Version: WI-V2.5.0.26074 Firebird 2.5
Server version:
Firebird/x86/Windows NT (access method), version "WI-V2.5.0.26074 Firebird 2.5"
Firebird/x86/Windows NT (remote server), version "WI-V2.5.0.26074 Firebird 2.5/tcp (csprog)/P12"
Firebird/x86/Windows NT (remote interface), version "WI-V2.5.0.26074 Firebird 2.5/tcp (csprog)/P12"
on disk structure version 11.2
============
1
Current memory = 36255732
Delta memory = 727292
Max memory = 36314920
Elapsed time= 0.02 sec
Buffers = 8192
Reads = 17
Writes 0
Fetches = 263
Why the elapsed time in 3.0 is more than 100x worse than in 2.5.x ?
The text was updated successfully, but these errors were encountered: