bug: huge db query for funtion #5339

Closed
opened 2025-11-11 16:17:52 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @U8F69 on GitHub (May 27, 2025).

Check Existing Issues

  • I have searched the existing issues and discussions.

Problem Description

This commit (74ace200fe) removes the function cache, resulting in a significant increase in unnecessary database queries when using filters. Additionally, the database bandwidth usage now depends on the length of the filter code.

def load_function_module_by_id(function_id, content=None):
    ...
        function = Functions.get_function_by_id(function_id)
    ...

Desired Solution you'd like

Add a function cache

Alternatives Considered

No response

Additional Context

No response

Originally created by @U8F69 on GitHub (May 27, 2025). ### Check Existing Issues - [x] I have searched the existing issues and discussions. ### Problem Description This commit (https://github.com/open-webui/open-webui/commit/74ace200fead4fe407fce9868d0ba47bb3032add) removes the function cache, resulting in a significant increase in unnecessary database queries when using filters. Additionally, the database bandwidth usage now depends on the length of the filter code. ``` def load_function_module_by_id(function_id, content=None): ... function = Functions.get_function_by_id(function_id) ... ``` ### Desired Solution you'd like Add a function cache ### Alternatives Considered _No response_ ### Additional Context _No response_
Author
Owner

@tjbck commented on GitHub (May 27, 2025):

intended behaviour.

@tjbck commented on GitHub (May 27, 2025): intended behaviour.
Author
Owner

@U8F69 commented on GitHub (May 27, 2025):

intended behaviour.

But we observed an increase in CPU for both open-webui and postgres, about 30%

@U8F69 commented on GitHub (May 27, 2025): > intended behaviour. But we observed an increase in CPU for both open-webui and postgres, about 30%
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#5339