From 2349d8f29b5e76cabe2d8f7ed0cc073b1788f411 Mon Sep 17 00:00:00 2001 From: Wind-Gone <1242378947@qq.com> Date: Thu, 28 Mar 2024 13:37:09 +0800 Subject: [PATCH] [fix] pg bugs --- analyzer/.idea/compiler.xml | 8 + .../.idea/copilot/chatSessions/00000000000.xd | Bin 0 -> 5923 bytes .../.idea/copilot/chatSessions/blobs/version | Bin 0 -> 4 bytes analyzer/.idea/copilot/chatSessions/xd.lck | 140 ++++++++++++++++ analyzer/.idea/jarRepositories.xml | 20 +++ analyzer/.idea/misc.xml | 12 ++ analyzer/.idea/vcs.xml | 6 + analyzer/.idea/workspace.xml | 151 ++++++++++++++++++ analyzer/src/main/java/org/dbhammer/Main.java | 15 ++ .../java/org/dbhammer/PostgresInstance.java | 52 ++++-- .../main/java/org/dbhammer/artemis_sql/1.sql | 22 ++- 11 files changed, 412 insertions(+), 14 deletions(-) create mode 100644 analyzer/.idea/compiler.xml create mode 100644 analyzer/.idea/copilot/chatSessions/00000000000.xd create mode 100644 analyzer/.idea/copilot/chatSessions/blobs/version create mode 100644 analyzer/.idea/copilot/chatSessions/xd.lck create mode 100644 analyzer/.idea/jarRepositories.xml create mode 100644 analyzer/.idea/misc.xml create mode 100644 analyzer/.idea/vcs.xml create mode 100644 analyzer/.idea/workspace.xml diff --git a/analyzer/.idea/compiler.xml b/analyzer/.idea/compiler.xml new file mode 100644 index 0000000..a1757ae --- /dev/null +++ b/analyzer/.idea/compiler.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/analyzer/.idea/copilot/chatSessions/00000000000.xd b/analyzer/.idea/copilot/chatSessions/00000000000.xd new file mode 100644 index 0000000000000000000000000000000000000000..f36d5eddb4a62e986701783f4426de9620920a39 GIT binary patch literal 5923 zcmcgwdu&tJ89%;G{ED4~kYpWn)DYT2N8H$X6uKcnd6Wjq5Ut8%rNgmr!Ue}Ren5g) z<#S>mziylaLSBUM$U6iIEz;I?e{_{5tre=KZvX6|{n1vHw)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atSessions/blobs/version new file mode 100644 index 0000000000000000000000000000000000000000..720d64f4baafc33efdf971f02084aca5f25b34a5 GIT binary patch literal 4 LcmZQzU|<9Q00jU7 literal 0 HcmV?d00001 diff --git a/analyzer/.idea/copilot/chatSessions/xd.lck b/analyzer/.idea/copilot/chatSessions/xd.lck new file mode 100644 index 0000000..74aee22 --- /dev/null +++ b/analyzer/.idea/copilot/chatSessions/xd.lck @@ -0,0 +1,140 @@ +Private property of Exodus: 83686@ZiruideMacBook-Pro.local + +jetbrains.exodus.io.LockingManager.lock(LockingManager.kt:88) +jetbrains.exodus.io.LockingManager.lock(LockingManager.kt:39) +jetbrains.exodus.io.FileDataWriter.lock(FileDataWriter.kt:70) +jetbrains.exodus.log.Log.tryLock(Log.kt:804) +jetbrains.exodus.log.Log.(Log.kt:117) +jetbrains.exodus.env.Environments.newLogInstance(Environments.kt:117) +jetbrains.exodus.env.Environments.newLogInstance(Environments.kt:81) +jetbrains.exodus.env.Environments.newLogInstance(Environments.kt:77) +jetbrains.exodus.env.Environments$newInstance$4.invoke(Environments.kt:46) +jetbrains.exodus.env.Environments$newInstance$4.invoke(Environments.kt:46) +jetbrains.exodus.env.Environments.prepare(Environments.kt:120) +jetbrains.exodus.env.Environments.newInstance(Environments.kt:46) +kotlinx.dnq.store.container.EntityStoreHelperKt.createTransientEntityStore(EntityStoreHelper.kt:40) +kotlinx.dnq.store.container.EntityStoreHelperKt.createTransientEntityStore(EntityStoreHelper.kt:31) +kotlinx.dnq.store.container.EntityStoreHelperKt.createTransientEntityStore$default(EntityStoreHelper.kt:30) +com.github.copilot.chat.session.persistence.xodus.XdChatSessionPersistenceService.initStore(XdChatSessionPersistenceService.kt:115) +com.github.copilot.chat.session.persistence.xodus.XdChatSessionPersistenceService.(XdChatSessionPersistenceService.kt:22) +com.github.copilot.chat.session.persistence.xodus.XdChatSessionPersistenceService.(XdChatSessionPersistenceService.kt:15) +com.github.copilot.chat.session.persistence.ChatSessionPersistenceServiceKt.ChatSessionPersistenceService(ChatSessionPersistenceService.kt:43) +com.github.copilot.chat.session.persistence.ChatSessionPersistenceServiceKt.chatSessionsPersistenceService(ChatSessionPersistenceService.kt:53) +com.github.copilot.chat.session.ChatSessionManager.(ChatSessionManager.kt:45) +com.github.copilot.chat.session.ChatSessionManager.(ChatSessionManager.kt:25) +com.github.copilot.chat.window.CopilotChatToolWindow.onCopilotReady(CopilotChatToolWindow.kt:133) +com.github.copilot.chat.window.CopilotChatToolWindow.access$onCopilotReady(CopilotChatToolWindow.kt:40) +com.github.copilot.chat.window.CopilotChatToolWindow$initCopilotStatusListener$1.invoke(CopilotChatToolWindow.kt:118) +com.github.copilot.chat.window.CopilotChatToolWindow$initCopilotStatusListener$1.invoke(CopilotChatToolWindow.kt:115) +com.github.copilot.status.CopilotAuthStatusKt.subscribeToCopilotAuthStatus(CopilotAuthStatus.kt:27) +com.github.copilot.chat.window.CopilotChatToolWindow.initCopilotStatusListener(CopilotChatToolWindow.kt:115) +com.github.copilot.chat.window.CopilotChatToolWindow.(CopilotChatToolWindow.kt:59) +com.github.copilot.chat.window.CopilotChatToolWindow.(CopilotChatToolWindow.kt:40) +com.github.copilot.chat.window.CopilotChatToolWindowFactory.init(CopilotChatToolWindowFactory.kt:18) +com.intellij.openapi.wm.impl.ToolWindowManagerImpl.registerToolWindow$intellij_platform_ide_impl(ToolWindowManagerImpl.kt:1123) +com.intellij.toolWindow.ToolWindowSetInitializerKt.registerToolWindows(ToolWindowSetInitializer.kt:223) +com.intellij.toolWindow.ToolWindowSetInitializerKt.access$registerToolWindows(ToolWindowSetInitializer.kt:1) +com.intellij.toolWindow.ToolWindowSetInitializer$createAndLayoutToolWindows$entries$1$1.invokeSuspend(ToolWindowSetInitializer.kt:141) +com.intellij.toolWindow.ToolWindowSetInitializer$createAndLayoutToolWindows$entries$1$1.invoke(ToolWindowSetInitializer.kt) +com.intellij.toolWindow.ToolWindowSetInitializer$createAndLayoutToolWindows$entries$1$1.invoke(ToolWindowSetInitializer.kt) +kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:78) +kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:167) +kotlinx.coroutines.BuildersKt.withContext(Unknown Source) +com.intellij.platform.diagnostic.telemetry.impl.TracerKt.span(tracer.kt:53) +com.intellij.platform.diagnostic.telemetry.impl.TracerKt.span$default(tracer.kt:49) +com.intellij.toolWindow.ToolWindowSetInitializer$createAndLayoutToolWindows$entries$1.invokeSuspend(ToolWindowSetInitializer.kt:138) +kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) +kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108) +com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:194) +com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:843) +com.intellij.openapi.application.impl.ApplicationImpl$4.run(ApplicationImpl.java:463) +com.intellij.openapi.application.impl.RwLockHolder.runWithEnabledImplicitRead(RwLockHolder.kt:75) +com.intellij.openapi.application.impl.RwLockHolder.runWithImplicitRead(RwLockHolder.kt:67) +com.intellij.openapi.application.impl.ApplicationImpl.runWithImplicitRead(ApplicationImpl.java:1436) +com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:82) +com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:124) +com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:44) +java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318) +java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:792) +java.desktop/java.awt.EventQueue$3.run(EventQueue.java:739) +java.desktop/java.awt.EventQueue$3.run(EventQueue.java:733) +java.base/java.security.AccessController.doPrivileged(AccessController.java:399) +java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) +java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:761) +com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:695) +com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$12(IdeEventQueue.kt:589) +com.intellij.openapi.application.impl.RwLockHolder.runWithoutImplicitRead(RwLockHolder.kt:44) +com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:589) +com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:72) +com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:355) +com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:354) +com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:793) +com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:354) +com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:349) +com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:1014) +com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:114) +com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1014) +com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$7(IdeEventQueue.kt:349) +com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:843) +com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:391) +com.intellij.openapi.progress.impl.PlatformTaskSupportKt.pumpEventsForHierarchy(PlatformTaskSupport.kt:396) +com.intellij.openapi.progress.impl.PlatformTaskSupportKt.access$pumpEventsForHierarchy(PlatformTaskSupport.kt:1) +com.intellij.openapi.progress.impl.PlatformTaskSupport$runWithModalProgressBlockingInternal$2.invoke(PlatformTaskSupport.kt:156) +com.intellij.openapi.progress.impl.PlatformTaskSupport$runWithModalProgressBlockingInternal$2.invoke(PlatformTaskSupport.kt:134) +com.intellij.openapi.application.impl.ModalityKt.inModalContext(modality.kt:12) +com.intellij.openapi.progress.impl.PlatformTaskSupport.runWithModalProgressBlockingInternal(PlatformTaskSupport.kt:134) +com.intellij.openapi.progress.impl.PlatformTaskSupport.access$runWithModalProgressBlockingInternal(PlatformTaskSupport.kt:48) +com.intellij.openapi.progress.impl.PlatformTaskSupport$runWithModalProgressBlockingInternal$1.invoke(PlatformTaskSupport.kt:122) +com.intellij.openapi.progress.impl.PlatformTaskSupport$runWithModalProgressBlockingInternal$1.invoke(PlatformTaskSupport.kt:118) +com.intellij.openapi.progress.ContextKt.prepareThreadContext(context.kt:86) +com.intellij.openapi.progress.impl.PlatformTaskSupport.runWithModalProgressBlockingInternal(PlatformTaskSupport.kt:118) +com.intellij.platform.ide.progress.TasksKt.runWithModalProgressBlocking(tasks.kt:173) +com.intellij.platform.ide.progress.TasksKt.runWithModalProgressBlocking$default(tasks.kt:167) +com.intellij.ide.actions.OpenFileAction$actionPerformed$1.invoke(OpenFileAction.kt:85) +com.intellij.ide.actions.OpenFileAction$actionPerformed$1.invoke(OpenFileAction.kt:76) +com.intellij.ide.actions.OpenFileAction.actionPerformed$lambda$0(OpenFileAction.kt:76) +com.intellij.ui.mac.MacPathChooserDialog.choose(MacPathChooserDialog.java:153) +com.intellij.openapi.fileChooser.FileChooser.chooseFiles(FileChooser.java:100) +com.intellij.openapi.fileChooser.FileChooser.chooseFiles(FileChooser.java:78) +com.intellij.ide.actions.OpenFileAction.actionPerformed(OpenFileAction.kt:76) +com.intellij.openapi.actionSystem.ex.ActionUtil.doPerformActionOrShowPopup(ActionUtil.java:344) +com.intellij.openapi.actionSystem.ex.ActionUtil.lambda$performActionDumbAwareWithCallbacks$4(ActionUtil.java:318) +com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareWithCallbacks(ActionUtil.java:381) +com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAwareWithCallbacks(ActionUtil.java:318) +com.intellij.platform.ide.menu.MacNativeActionMenuItemKt.performAction$lambda$1(MacNativeActionMenuItem.kt:140) +com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:222) +com.intellij.platform.ide.menu.MacNativeActionMenuItemKt.performAction(MacNativeActionMenuItem.kt:128) +com.intellij.platform.ide.menu.MacNativeActionMenuItemKt.access$performAction(MacNativeActionMenuItem.kt:1) +com.intellij.platform.ide.menu.MacNativeActionMenuItem.lambda$2$lambda$1$lambda$0(MacNativeActionMenuItem.kt:82) +com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:114) +com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:95) +com.intellij.platform.ide.menu.MacNativeActionMenuItem.lambda$2$lambda$1(MacNativeActionMenuItem.kt:81) +java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318) +java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:792) +java.desktop/java.awt.EventQueue$3.run(EventQueue.java:739) +java.desktop/java.awt.EventQueue$3.run(EventQueue.java:733) +java.base/java.security.AccessController.doPrivileged(AccessController.java:399) +java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) +java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:761) +com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:695) +com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$12(IdeEventQueue.kt:589) +com.intellij.openapi.application.impl.RwLockHolder.runWithoutImplicitRead(RwLockHolder.kt:44) +com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:589) +com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:72) +com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:355) +com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:354) +com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:793) +com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:354) +com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:349) +com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:1014) +com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:106) +com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1014) +com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$7(IdeEventQueue.kt:349) +com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:848) +com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:391) +java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207) +java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128) +java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117) +java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113) +java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105) +java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92) diff --git a/analyzer/.idea/jarRepositories.xml b/analyzer/.idea/jarRepositories.xml new file mode 100644 index 0000000..712ab9d --- /dev/null +++ b/analyzer/.idea/jarRepositories.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/analyzer/.idea/misc.xml b/analyzer/.idea/misc.xml new file mode 100644 index 0000000..d5cd614 --- /dev/null +++ b/analyzer/.idea/misc.xml @@ -0,0 +1,12 @@ + + + + + + + + \ No newline at end of file diff --git a/analyzer/.idea/vcs.xml b/analyzer/.idea/vcs.xml new file mode 100644 index 0000000..6c0b863 --- /dev/null +++ b/analyzer/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/analyzer/.idea/workspace.xml b/analyzer/.idea/workspace.xml new file mode 100644 index 0000000..e63d421 --- /dev/null +++ b/analyzer/.idea/workspace.xml @@ -0,0 +1,151 @@ + + + + + + + + + + + + + + + + + { + "associatedIndex": 2 +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1711462050556 + + + + + + + + + + file://$PROJECT_DIR$/src/main/java/org/dbhammer/Main.java + 67 + + + + + \ No newline at end of file diff --git a/analyzer/src/main/java/org/dbhammer/Main.java b/analyzer/src/main/java/org/dbhammer/Main.java index b6038ef..8b8cb5b 100644 --- a/analyzer/src/main/java/org/dbhammer/Main.java +++ b/analyzer/src/main/java/org/dbhammer/Main.java @@ -9,6 +9,8 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; public class Main { private static final String SQL_FILE_DIRECTORY = "/home/jw/QueryPlanInject/analyzer/src/main/java/org/dbhammer/artemis_sql/"; @@ -33,6 +35,19 @@ private static List loadAllQueries() { } } + public static void regexExampleForPGINJ() { + String input = "(primarykey = table_3.fk_3)"; + String regex = "=\\s*(table_\\d+)"; + Pattern pattern = Pattern.compile(regex); + Matcher matcher = pattern.matcher(input); + if (matcher.find()) { + System.out.println(matcher.group(1)); + } else { + System.out.println("No match found"); + } + } + + public static void main(String[] args) { DBInstance obInstance = new OceanBaseInstance(); DBInstance tidbInstance = new TiDBInstance(); diff --git a/analyzer/src/main/java/org/dbhammer/PostgresInstance.java b/analyzer/src/main/java/org/dbhammer/PostgresInstance.java index 79a3c1e..83e30a3 100644 --- a/analyzer/src/main/java/org/dbhammer/PostgresInstance.java +++ b/analyzer/src/main/java/org/dbhammer/PostgresInstance.java @@ -12,6 +12,7 @@ import java.sql.ResultSet; import java.util.ArrayList; import java.util.List; +import java.util.Objects; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -89,27 +90,52 @@ public static void extractOperations(JsonNode node, QueryPlanInfo queryPlanInfo, for (JsonNode subOp : node.get("Plans")) extractOperations(subOp, queryPlanInfo, involvedTables); processJoinCondition("Join Filter", node, queryPlanInfo, involvedTables); // 提取 NLJ 的条件 + processJoinCondition("Index Cond", node, queryPlanInfo, involvedTables); // 提取 INLJ 的条件 processJoinCondition("Hash Cond", node, queryPlanInfo, involvedTables); processJoinCondition("Merge Cond", node, queryPlanInfo, involvedTables); } private static void processJoinCondition(String conditionType, JsonNode node, QueryPlanInfo queryPlanInfo, List involvedTables) { if (node.has(conditionType)) { - String condition = node.path(conditionType).asText(); - Matcher matcher = tablePattern.matcher(condition); - while (matcher.find()) { - String table1Name = matcher.group(1); - if (!involvedTables.contains(table1Name)) { - involvedTables.add(table1Name); - queryPlanInfo.addJoinOrder(table1Name); + if (Objects.equals(conditionType, "Index Cond")) { + String condition = node.path(conditionType).asText(); + String regex = "=\\s*(table_\\d+)"; + Pattern pattern = Pattern.compile(regex); + Matcher matcher = pattern.matcher(condition); + if (matcher.find()) { + int estimatedRows = node.path("Plan Rows").asInt(); + String table1Name = node.path("Alias").asText(); + String table2Name = matcher.group(1); + if (!involvedTables.contains(table1Name)) { + involvedTables.add(table1Name); + queryPlanInfo.addJoinOrder(table1Name); + } + if (!involvedTables.contains(table2Name)) { + involvedTables.add(table2Name); + queryPlanInfo.addJoinOrder(table2Name); + } + if (!condition.isEmpty()) + queryPlanInfo.addJoinOperation(new QueryPlanInfo.JoinOperation(table1Name, table2Name, "Nested Loop", estimatedRows, estimatedRows)); } - String table2Name = matcher.group(2); - if (!involvedTables.contains(table2Name)) { - involvedTables.add(table2Name); - queryPlanInfo.addJoinOrder(table2Name); + + } else { + String condition = node.path(conditionType).asText(); + Matcher matcher = tablePattern.matcher(condition); + while (matcher.find()) { + int estimatedRows = node.path("Plan Rows").asInt(); + String table1Name = matcher.group(1); + if (!involvedTables.contains(table1Name)) { + involvedTables.add(table1Name); + queryPlanInfo.addJoinOrder(table1Name); + } + String table2Name = matcher.group(2); + if (!involvedTables.contains(table2Name)) { + involvedTables.add(table2Name); + queryPlanInfo.addJoinOrder(table2Name); + } + if (!condition.isEmpty()) + queryPlanInfo.addJoinOperation(new QueryPlanInfo.JoinOperation(table1Name, table2Name, node.path("Node Type").asText(), estimatedRows, estimatedRows)); } - if (!condition.isEmpty()) - queryPlanInfo.addJoinOperation(new QueryPlanInfo.JoinOperation(table1Name, table2Name, node.path("Node Type").asText(), 0, 0)); } } } diff --git a/analyzer/src/main/java/org/dbhammer/artemis_sql/1.sql b/analyzer/src/main/java/org/dbhammer/artemis_sql/1.sql index f4df645..4e4db3e 100644 --- a/analyzer/src/main/java/org/dbhammer/artemis_sql/1.sql +++ b/analyzer/src/main/java/org/dbhammer/artemis_sql/1.sql @@ -1 +1,21 @@ -select count(*) as result from table_1, table_2, table_3, table_4, table_5, table_6, table_7 where table_3.fk_3 = table_2.primaryKey and table_3.fk_0 = table_5.primaryKey and table_2.fk_6 = table_4.primaryKey and table_4.fk_4 = table_6.primaryKey and table_5.fk_2 = table_7.primaryKey and table_6.fk_5 = table_1.primaryKey and table_3.col_2 between 805152.8892859903693152 and 1371080.6539595037674712 and table_2.col_1 not in (605236, 474084, 503070, 554259) and table_5.col_6 > 663759.0426306412552409 and table_4.col_9 in (665403, 666955, 676750, 681870, 678555, 668917, 671826, 670146) and table_6.col_6 >= 677279.9921799572130953 and table_7.col_7 < 677377.376977851837018556 and table_1.col_7 not in (677362, 677375, 677368, 677363); \ No newline at end of file +select count(*) as result +from table_1, + table_2, + table_3, + table_4, + table_5, + table_6, + table_7 +where table_3.fk_3 = table_2.primaryKey + and table_3.fk_0 = table_5.primaryKey + and table_2.fk_6 = table_4.primaryKey + and table_4.fk_4 = table_6.primaryKey + and table_5.fk_2 = table_7.primaryKey + and table_6.fk_5 = table_1.primaryKey + and table_3.col_2 between 805152.8892859903693152 and 1371080.6539595037674712 + and table_2.col_1 not in (605236, 474084, 503070, 554259) + and table_5.col_6 > 663759.0426306412552409 + and table_4.col_9 in (665403, 666955, 676750, 681870, 678555, 668917, 671826, 670146) + and table_6.col_6 >= 677279.9921799572130953 + and table_7.col_7 < 677377.376977851837018556 + and table_1.col_7 not in (677362, 677375, 677368, 677363); \ No newline at end of file