summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Schneider2020-04-29 16:37:27 +0200
committerChristian Schneider2020-04-29 16:37:27 +0200
commit5226a0149d1d49aef506535c8d27b00981dcd115 (patch)
tree0e633d8f4b480ffba4ca7aa3f4676f60bda9da2c
parentf6e5b115faeef0ea0ad47811c7d2facf954bbe48 (diff)
downloaditools-5226a0149d1d49aef506535c8d27b00981dcd115.tar.gz
itools-5226a0149d1d49aef506535c8d27b00981dcd115.tar.bz2
itools-5226a0149d1d49aef506535c8d27b00981dcd115.zip
Check fields used with NI for NULL first to take advantage of indices
-rw-r--r--it_dbi.class2
1 files changed, 1 insertions, 1 deletions
diff --git a/it_dbi.class b/it_dbi.class
index 3620018..39f50a7 100644
--- a/it_dbi.class
+++ b/it_dbi.class
@@ -401,7 +401,7 @@ function _where($params)
foreach ((array)$value as $val)
$parts[] = "CONCAT(',',$field,',') LIKE " . $this->escape_string("%,$val,%");
- $query .= $sep . "(" . join(" OR ", $parts) . ")";
+ $query .= $sep . "$field IS NOT NULL AND (" . join(" OR ", $parts) . ")"; # Check for IS NOT NULL to take advantage of index
}
else
$query .= $sep . "1";