Skip to content

[Improvement-18443][API&DAO] Optimize WorkflowInstanceMapper to exclude large text fields from list queries - #18444

Open
njnu-seafish wants to merge 3 commits into
apache:devfrom
njnu-seafish:Improvement-18443
Open

[Improvement-18443][API&DAO] Optimize WorkflowInstanceMapper to exclude large text fields from list queries#18444
njnu-seafish wants to merge 3 commits into
apache:devfrom
njnu-seafish:Improvement-18443

Conversation

@njnu-seafish

@njnu-seafish njnu-seafish commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Was this PR generated or assisted by AI?

YES. Leverage LLMs to verify that the removed large text fields are indeed unused.

Purpose of the pull request

close #18443

Brief change log

The WorkflowInstanceMapper was returning all fields including large text/longtext fields (command_param, global_params, history_cmd, var_pool, state_history) for all queries,which caused unnecessary database I/O, network transfer, and memory usage. This commit adds a dedicated listSql SQL fragment that excludes these large fields, and updates the following list query methods to use them:

  • queryByHostAndStatus
  • queryTopNWorkflowInstance
  • queryByTenantCodeAndStatus
  • queryByWorkerGroupNameAndStatus
  • queryWorkflowInstanceListPaging
  • queryByWorkflowDefinitionCode
  • queryFirstScheduleWorkflowInstance
  • queryFirstStartWorkflowInstance
  • queryByWorkflowDefinitionCodeAndStatus
  • queryByWorkflowCodeVersionStatus
  • queryWorkflowInstanceListV2Paging
  • queryByTriggerCode

Verify this pull request

This pull request is code cleanup without any test coverage.

(or)

This pull request is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(or)

Pull Request Notice

Pull Request Notice

If your pull request contains incompatible change, you should also add it to docs/docs/en/guide/upgrade/incompatible.md

@SbloodyS SbloodyS added the improvement make more easy to user or prompt friendly label Jul 26, 2026
@SbloodyS SbloodyS added this to the 3.5.0 milestone Jul 26, 2026
@njnu-seafish

Copy link
Copy Markdown
Contributor Author

The CI pipeline shows the following error:
screenshot_1785117843013

But it runs successfully on my local machine every time.
screenshot_1785117780443

@njnu-seafish

Copy link
Copy Markdown
Contributor Author
screenshot_1785217582361 @SbloodyS This error seems to be a frontend issue during the E2E test and is likely unrelated to my changes. Could you please help re-trigger the CI? Thanks a lot!

@SbloodyS

Copy link
Copy Markdown
Member

CI has been reruned. @njnu-seafish

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend improvement make more easy to user or prompt friendly

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Improvement][API&DAO] Unnecessary Large Text Fields Returned in WorkflowInstanceMapper Queries

2 participants