Skip to content

Commit

Permalink
Show filter condition in node detail via tooltip
Browse files Browse the repository at this point in the history
Fixes #614
  • Loading branch information
pgiraud committed Aug 22, 2024
1 parent da8d20a commit eb7a95c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/components/PlanNodeDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const {
durationClass,
estimationClass,
executionTimePercent,
filterDetailTooltip,
heapFetchesClass,
plannerRowEstimateDirection,
plannerRowEstimateValue,
Expand Down Expand Up @@ -262,6 +263,12 @@ watch(activeTab, () => {
>{{ rowsRemovedPercentString }}%</span
>
</span>
<FontAwesomeIcon
fixed-width
:icon="faInfoCircle"
class="text-muted"
v-tippy="{ allowHTML: true, content: filterDetailTooltip }"
></FontAwesomeIcon>
</div>
<div v-if="node[NodeProp.HEAP_FETCHES]">
<FontAwesomeIcon
Expand Down
1 change: 1 addition & 0 deletions src/enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ export enum NodeProp {
FULL_SORT_GROUPS = "Full-sort Groups",
PRE_SORTED_GROUPS = "Pre-sorted Groups",
PRESORTED_KEY = "Presorted Key",
FILTER = "Filter",

// computed by pev
NODE_ID = "nodeId",
Expand Down
1 change: 1 addition & 0 deletions src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export class Node {
[NodeProp.EXCLUSIVE_SHARED_WRITTEN_BLOCKS]: number;
[NodeProp.EXCLUSIVE_TEMP_READ_BLOCKS]: number;
[NodeProp.EXCLUSIVE_TEMP_WRITTEN_BLOCKS]: number;
[NodeProp.FILTER]: string;
[NodeProp.PLANNER_ESTIMATE_DIRECTION]?: EstimateDirection;
[NodeProp.PLANNER_ESTIMATE_FACTOR]?: number;
[NodeProp.INDEX_NAME]?: string;
Expand Down
7 changes: 7 additions & 0 deletions src/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,12 @@ export default function useNode(
return rowsRemovedPercentString.value + "% of rows removed by filter"
})

const filterDetailTooltip = computed((): string => {
return `Filter used:<br><pre class="mb-0" style="white-space: pre-wrap;"><code>${
node[NodeProp.FILTER]
}</code></pre>`
})

const isNeverExecuted = computed((): boolean => {
return !!plan.value.planStats.executionTime && !node[NodeProp.ACTUAL_LOOPS]
})
Expand Down Expand Up @@ -529,6 +535,7 @@ export default function useNode(
estimationClass,
executionTimePercent,
filterTooltip,
filterDetailTooltip,
heapFetchesClass,
heapFetchesTooltip,
highlightValue,
Expand Down

0 comments on commit eb7a95c

Please sign in to comment.