mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-12-16 14:49:23 +08:00
fix(db): Don't blow up over table SCANs with covering indexes
This commit is contained in:
parent
5220b471e3
commit
f906b0bc12
1 changed files with 2 additions and 2 deletions
|
|
@ -273,10 +273,10 @@ class DatabaseStore extends NylasStore
|
||||||
if DEBUG_QUERY_PLANS
|
if DEBUG_QUERY_PLANS
|
||||||
@_db.all "EXPLAIN QUERY PLAN #{query}", values, (err, results=[]) =>
|
@_db.all "EXPLAIN QUERY PLAN #{query}", values, (err, results=[]) =>
|
||||||
str = results.map((row) -> row.detail).join('\n') + " for " + query
|
str = results.map((row) -> row.detail).join('\n') + " for " + query
|
||||||
return if str.indexOf("SCAN") is -1
|
|
||||||
return if str.indexOf('ThreadCounts') > 0
|
return if str.indexOf('ThreadCounts') > 0
|
||||||
return if str.indexOf('ThreadSearch') > 0
|
return if str.indexOf('ThreadSearch') > 0
|
||||||
@_prettyConsoleLog(str)
|
if str.indexOf('SCAN') isnt -1 and str.indexOf('COVERING INDEX') is -1
|
||||||
|
@_prettyConsoleLog(str)
|
||||||
|
|
||||||
# Important: once the user begins a transaction, queries need to run
|
# Important: once the user begins a transaction, queries need to run
|
||||||
# in serial. This ensures that the subsequent "COMMIT" call
|
# in serial. This ensures that the subsequent "COMMIT" call
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue