I have 3 indexed fields in a query:
The query performs well when all 3 conditions are specified with real values. The
int columns always have values, but there are plenty of empty string
varchar values. Queries with the empty string
varchar parameter perform 2-3x slower than those that search a real string (e.g. 'hello'). The query against the
varchar column is a straight
WHERE clause (i.e. no
I've searched around a bit but really only seem to see academic type discussions around this and I, frankly, don't really care about how they can mean different things. I only care about the performance of the queries against a
NULL or empty string
Is this empty string the cause of the slowness? Would a
NULL in it's place improve things? I can easily turn existing empty strings into
NULLs and put some new logic in to make sure empty strings are always put in as
NULLs. I just figured I'd ask here to get the expert opinion on this.
I'll be toying around with this anyway but it'd be nice to get an outside view telling me if I'm just spinning my wheels on it, if that's the case.