SQL case indexes

#3329
I think this should be true although i'm not 100% sure.