mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
Fix inefficient extra_vars loading query
This commit is contained in:
parent
af8e510ca2
commit
30d7912054
3 changed files with 6 additions and 1 deletions
|
|
@ -113,6 +113,7 @@ class Document extends ModuleObject
|
|||
// 2025.10.23 Add sort to document_extra_keys table, and sort_value to document_extra_vars table
|
||||
if(!$oDB->isColumnExists('document_extra_keys', 'var_sort')) return true;
|
||||
if(!$oDB->isColumnExists('document_extra_vars', 'sort_value') || !$oDB->isIndexExists('document_extra_vars', 'idx_sort_value')) return true;
|
||||
if(!$oDB->isIndexExists('document_extra_vars', 'idx_document_var_idx')) return true;
|
||||
if(!$oDB->isIndexExists('document_extra_vars', 'idx_prefix_value')) return true;
|
||||
|
||||
// Delete unnecessary index
|
||||
|
|
@ -265,6 +266,10 @@ class Document extends ModuleObject
|
|||
$oDB->commit();
|
||||
$oDB->addIndex('document_extra_vars', 'idx_sort_value', array('module_srl', 'sort_value'));
|
||||
}
|
||||
if(!$oDB->isIndexExists('document_extra_vars', 'idx_document_var_idx'))
|
||||
{
|
||||
$oDB->addIndex('document_extra_vars', 'idx_document_var_idx', array('document_srl', 'var_idx'));
|
||||
}
|
||||
if(!$oDB->isIndexExists('document_extra_vars', 'idx_prefix_value'))
|
||||
{
|
||||
$oDB->addIndex('document_extra_vars', 'idx_prefix_value', array('module_srl', 'value(10)'));
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
<column name="*" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="more" column="extra_vars.module_srl" default="-1" notnull="notnull" pipe="and" />
|
||||
<condition operation="in" column="extra_vars.document_srl" var="document_srl" notnull="notnull" pipe="and" />
|
||||
<condition operation="more" column="extra_vars.var_idx" default="-2" pipe="and" />
|
||||
</conditions>
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
<column name="value" type="bigtext" />
|
||||
<column name="sort_value" type="bigint" />
|
||||
<column name="eid" type="varchar" size="40" />
|
||||
<index name="idx_document_var_idx" columns="document_srl,var_idx" />
|
||||
<index name="idx_prefix_value" columns="module_srl,value(10)" />
|
||||
<index name="idx_sort_value" columns="module_srl,sort_value" />
|
||||
</table>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue