Merge pull request #803 from bjrambo/pr/comment-index

댓글 삭제시 parent_srl 에 인덱스가 없어 쿼리시간이 오래걸리는 문제 고침
This commit is contained in:
BJRambo 2017-04-24 22:10:42 +09:00 committed by GitHub
commit 099e371e30
2 changed files with 11 additions and 1 deletions

View file

@ -105,6 +105,11 @@ class comment extends ModuleObject
return true; return true;
} }
if(!$oDB->isIndexExists("comments", "idx_parent_srl"))
{
return true;
}
return FALSE; return FALSE;
} }
@ -185,6 +190,11 @@ class comment extends ModuleObject
$oDB->addColumn('comment_declared_log',"declare_message","text"); $oDB->addColumn('comment_declared_log',"declare_message","text");
} }
if(!$oDB->isIndexExists("comments", "idx_parent_srl"))
{
$oDB->addIndex('comments', 'idx_parent_srl', array('parent_srl'));
}
return new Object(0, 'success_updated'); return new Object(0, 'success_updated');
} }

View file

@ -2,7 +2,7 @@
<column name="comment_srl" type="number" size="11" notnull="notnull" primary_key="primary_key" /> <column name="comment_srl" type="number" size="11" notnull="notnull" primary_key="primary_key" />
<column name="module_srl" type="number" size="11" default="0" notnull="notnull" index="idx_module_srl" /> <column name="module_srl" type="number" size="11" default="0" notnull="notnull" index="idx_module_srl" />
<column name="document_srl" type="number" size="11" default="0" notnull="notnull" index="idx_document_srl" /> <column name="document_srl" type="number" size="11" default="0" notnull="notnull" index="idx_document_srl" />
<column name="parent_srl" type="number" size="11" default="0" notnull="notnull" /> <column name="parent_srl" type="number" size="11" default="0" notnull="notnull" index="idx_parent_srl" />
<column name="is_secret" type="char" size="1" default="N" notnull="notnull" /> <column name="is_secret" type="char" size="1" default="N" notnull="notnull" />
<column name="content" type="bigtext" notnull="notnull" /> <column name="content" type="bigtext" notnull="notnull" />
<column name="voted_count" type="number" size="11" default="0" notnull="notnull" index="idx_voted_count" /> <column name="voted_count" type="number" size="11" default="0" notnull="notnull" index="idx_voted_count" />