Bad performance of security checking during prepare [CORE1775] #2199
Submitted by: @hvlad
Starting with 2.0 release security checks was slow compared with 1.5.x releases.
I have test case, sent to me privately, where prepare of statement took 15 ms on FB 1.5.4 and more than 90ms on higher versions.
The reasons for slowdown is :
b) Since v2.1 i see fetches from both RDB$RELATIONS and RDB$RELATION_FIELDS during prepare while v1.5.4 and v2.0.3 fetches only RDB$RELATION_FIELDS. I found that CMP\verify_trigger_access calls MET_lookup_field only before v 2.1 and both MET_lookup_field and MET_relation_default_class since v2.1. So far i didn't found reasons why it is so.
Offered solution :
a) in HEAD (v2.5) i'll replace linked list of SecurityClass'es by BePlusTree to allow faster searches.
b) in 2.0.x and 2.1.x releases i offer to return strcnmp() instead of operator == for string comparison in SCL_get_class
The text was updated successfully, but these errors were encountered: