indexing - multple indexes same column sql -


for db2 database, consider table tbl (cola, colb, colc) , queries as

select *  tbl tbl.cola = 1234.  select * tbl tbl.cola =1234 , tbl.colb = 73874 

will if create 2 indexes i) on cola ii) composite - cola,colb

if above sql's accessed have 2 indexes above. optemizer pick correct index based on query. thanks,

you need index (ii). composite index used whenever search data in prefix of columns. index on cola,colb,colc,cold used when search cola, cola , colb, cola, colb, , colc, , cola, colb, colc, , cold.


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -