提交 ddd4d28c authored 作者: Noel Grandin's avatar Noel Grandin

Improve performance of cleaning up temp tables - patch from Eric Faulhaber.

上级 55e9b945
......@@ -21,6 +21,8 @@ Change Log
<h2>Next Version (unreleased)</h2>
<ul>
<li>Improve performance of cleaning up temp tables - patch from Eric Faulhaber.
</li>
<li>Fix bug where table locks were not dropped when the connection closed
</li>
<li>Fix extra CPU usage caused by query planner enhancement in 1.4.191
......
......@@ -928,11 +928,13 @@ public class Session extends SessionWithState {
private void cleanTempTables(boolean closeSession) {
if (localTempTables != null && localTempTables.size() > 0) {
synchronized (database) {
for (Table table : New.arrayList(localTempTables.values())) {
Iterator<Table> itr = localTempTables.values().iterator();
while (itr.hasNext()) {
Table table = itr.next();
if (closeSession || table.getOnCommitDrop()) {
modificationId++;
table.setModified();
localTempTables.remove(table.getName());
itr.remove();
table.removeChildrenAndResources(this);
if (closeSession) {
// need to commit, otherwise recovery might
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论