Improved database index handling
This commit is contained in:
parent
070c5139e1
commit
d34b60dc8f
1 changed files with 7 additions and 14 deletions
|
|
@ -661,24 +661,17 @@ public class Lookup extends Queue {
|
||||||
|
|
||||||
String unionSelect = "SELECT * FROM (";
|
String unionSelect = "SELECT * FROM (";
|
||||||
if (Config.getGlobal().MYSQL) {
|
if (Config.getGlobal().MYSQL) {
|
||||||
if (radius == null || users.length() > 0 || includeBlock.length() > 0 || includeEntity.length() > 0) {
|
|
||||||
// index_mysql = "IGNORE INDEX(wid) ";
|
|
||||||
if (users.length() > 0) {
|
|
||||||
// index_mysql = "IGNORE INDEX(wid,type,action) ";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (queryTable.equals("block")) {
|
if (queryTable.equals("block")) {
|
||||||
if (includeBlock.length() > 0 || includeEntity.length() > 0) {
|
if (includeBlock.length() > 0 || includeEntity.length() > 0) {
|
||||||
index = "USE INDEX(type) ";
|
index = "USE INDEX(type) IGNORE INDEX(user,wid) ";
|
||||||
}
|
}
|
||||||
if (users.length() > 0) {
|
if (users.length() > 0) {
|
||||||
index = "USE INDEX(user) ";
|
index = "USE INDEX(user) IGNORE INDEX(type,wid) ";
|
||||||
}
|
}
|
||||||
if ((index.equals("") && restrictWorld)) {
|
if (radius != null && (radius[2] - radius[1]) <= 50 && (radius[6] - radius[5]) <= 50) {
|
||||||
index = "USE INDEX(wid) ";
|
index = "USE INDEX(wid) IGNORE INDEX(type,user) ";
|
||||||
}
|
}
|
||||||
if ((radius != null || actionList.size() > 0)) {
|
if ((restrictWorld && (users.length() > 0 || includeBlock.length() > 0 || includeEntity.length() > 0))) {
|
||||||
index = "";
|
index = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -693,10 +686,10 @@ public class Lookup extends Queue {
|
||||||
if (users.length() > 0) {
|
if (users.length() > 0) {
|
||||||
index = "INDEXED BY block_user_index ";
|
index = "INDEXED BY block_user_index ";
|
||||||
}
|
}
|
||||||
if ((index.equals("") && restrictWorld)) {
|
if (radius != null && (radius[2] - radius[1]) <= 50 && (radius[6] - radius[5]) <= 50) {
|
||||||
index = "INDEXED BY block_index ";
|
index = "INDEXED BY block_index ";
|
||||||
}
|
}
|
||||||
if ((radius != null || actionList.size() > 0)) {
|
if ((restrictWorld && (users.length() > 0 || includeBlock.length() > 0 || includeEntity.length() > 0))) {
|
||||||
index = "";
|
index = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue