-
Performance using a table to combine where phrases
Hi all,
Passing a table in to a where clause instead of the individual values significantly affects performance, even compared to using & to join all the where phrases into one. What is the query doing under the covers?
1#.eoh.f date SRC PRICE_TYPE INDEX1 INDEX2 CONTRACT1 PROFILE CONTRACT_TYPE -------------------------------------------------------------------------- 2023.06.28 market dev JPM 2023.10.M BLA // PUBLICATIONS is date-partitioned, and doesn't have attributes on the columns we filter on ts select from PUBLICATIONS where ([]date;SRC;PRICE_TYPE;INDEX1;INDEX2;CONTRACT1;PROFILE;CONTRACT_TYPE) in 1#.eoh.f 1176 177568 ts select from PUBLICATIONS where date=2023.06.28,src=`market,PRICE_TYPE=`dev,INDEX1=`JPM,INDEX2=`,CONTRACT1=`2023.10.M,PROFILE=`,CONTRACT_TYPE=`BLA 5 2101760 ts select from PUBLICATIONS where (date=2023.06.28)&(src=`market)&(PRICE_TYPE=`dev)&(INDEX1=`JPM)&(INDEX2=`)&(CONTRACT1=`2023.10.M)&(PROFILE=`)&CONTRACT_TYPE=`BLA 531 179664 ts select from PUBLICATIONS where (date in 2023.06.28)&(SRC in `market)&(PRICE_TYPE in `dev)&(INDEX1 in `JPM)&(INDEX2 in `)&(CONTRACT1 in `2023.10.M)&(PROFILE in `)&CONTRACT_TYPE in `BLA 504 179664
Using kdb+ 3.5 2017.10.11
Thanks,
Eoghan
Log in to reply.