Subject | Re: [firebird-support] Best Practice in Use of Colon |
---|---|
Author | Ivan Přenosil |
Post date | 2014-01-21T13:59:56Z |
>Where the use of : is optional, as best practice should : be used or avoided.Inside "pure" sql statements it is manadatory (to distinguish between parameter name and column name),
>Or in such cases use of : is irrelevant in terms of performance.
on other places it does not matter, the parser accepts both variants (and they are identical)
> 2. I'm appending two stored procedures, one omits colon (Para 3 below) and another uses colon (Para 4 below) for fetchingThe first execute is longer because it also includes starting the transaction, fetching metadata etc.
> exactly the same data. The FlameRobin's Statistics TAB output on running the procedures (Firebird 3 on Windows 7 32 Bit) is
> listed as under for both the procedures, please notice the difference (omitting colon appears to be lowering performance) :
>
> OMITS COLON:- USES COLON:-
>
> Executing statement... Executing statement...
> Statement executed (elapsed time: 0.000s). Statement executed (elapsed time: 0.000s).
> 16541 fetches, 2 marks, 5 reads, 2 writes. 760 fetches, 0 marks, 0 reads, 0 writes.
> 0 inserts, 0 updates, 0 deletes, 72 index, 8064 seq. 0 inserts, 0 updates, 0 deletes, 71 index, 264 seq.
> Delta memory: 170752 bytes. Delta memory: 126824 bytes.
> Total execution time: 0.174s Total execution time: 0.049s
> Script execution finished. Script execution finished.
Ivan