Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workers count #679

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions src/components/WorkersDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,17 @@ const viewOptions = inject(ViewOptionsKey) as ViewOptions
const helpService = new HelpService()
const getHelpMessage = helpService.getHelpMessage

const { workersLaunchedCount } = useNode(plan, node, viewOptions)
const { workersLaunchedCount, workersPlannedCount } = useNode(
plan,
node,
viewOptions
)
</script>
<template>
<!-- workers tab -->
<div>
<b>Workers planned: </b>
<span class="px-1">{{
node[NodeProp.WORKERS_PLANNED] || node[NodeProp.WORKERS_PLANNED_BY_GATHER]
}}</span>
<span class="px-1">{{ workersPlannedCount }} </span>
<em
v-if="
!node[NodeProp.WORKERS_PLANNED] &&
Expand All @@ -50,6 +52,20 @@ const { workersLaunchedCount } = useNode(plan, node, viewOptions)
<div>
<b>Workers launched: </b>
<span class="px-1">{{ workersLaunchedCount }}</span>
<em
v-if="
!node[NodeProp.WORKERS_LAUNCHED] &&
!node[NodeProp.WORKERS] &&
(!plan.isVerbose || !plan.isAnalyze)
"
class="text-warning"
>
<FontAwesomeIcon
:icon="faExclamationTriangle"
class="cursor-help"
v-tippy="getHelpMessage('fuzzy needs verbose')"
></FontAwesomeIcon>
</em>
</div>
<div
v-if="!workersLaunchedCount && node[NodeProp.WORKERS_PLANNED_BY_GATHER]"
Expand Down
1 change: 1 addition & 0 deletions src/enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ export enum NodeProp {
AVERAGE_IO_WRITE_TIME = "*I/O Write Speed (exclusive)",

WORKERS_PLANNED_BY_GATHER = "*Workers Planned By Gather",
WORKERS_LAUNCHED_BY_GATHER = "*Workers Launched By Gather",

CTE_SCAN = "CTE Scan",
CTE_NAME = "CTE Name",
Expand Down
3 changes: 3 additions & 0 deletions src/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,9 @@ export default function useNode(
if (node[NodeProp.WORKERS_LAUNCHED]) {
return node[NodeProp.WORKERS_LAUNCHED] as number
}
if (node[NodeProp.WORKERS_LAUNCHED_BY_GATHER]) {
return node[NodeProp.WORKERS_LAUNCHED_BY_GATHER] as number
}
const workers = node[NodeProp.WORKERS] as Worker[]
return workers ? workers.length : NaN
})
Expand Down
3 changes: 3 additions & 0 deletions src/services/plan-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ export class PlanService {
child[NodeProp.WORKERS_PLANNED_BY_GATHER] =
node[NodeProp.WORKERS_PLANNED] ||
node[NodeProp.WORKERS_PLANNED_BY_GATHER]
child[NodeProp.WORKERS_LAUNCHED_BY_GATHER] =
node[NodeProp.WORKERS_LAUNCHED] ||
node[NodeProp.WORKERS_LAUNCHED_BY_GATHER]
}
if (this.isCTE(child)) {
plan.ctes.push(child)
Expand Down
Loading