On 17/06/2020 15:46, Leyne, Sean wrote: > >> So it's about this, correct? >> >> -- Uses two index segments >> select registro_sec_roest from dp_registro_oest where registro_pri_roest = 1 >> and registro_sec_roest = 1; >> >> -- Uses one index segment - more generalization of IN problem select >> registro_sec_roest from dp_registro_oest where registro_pri_roest = 1 and >> registro_sec_roest in (1, 2); >> >> -- Uses one index segment - IN problem >> select registro_sec_roest from dp_registro_oest where registro_pri_roest = 1 >> and (registro_sec_roest = 1 or registro_sec_roest is null); > What about: > > select registro_sec_roest from dp_registro_oest where registro_pri_roest = 1 > and (registro_sec_roest = 1 or registro_sec_roest = 2); > > How many segments would be used? (IMO answer should be 2) > > x IN (constant_list) is the same as (x = n1 or x = n2 or ...) for the engine, so 1.
Adriano Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel