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

minor optimization for get_response table, created_at index #3389

Open
botnumberseven opened this issue Nov 3, 2024 · 0 comments
Open

minor optimization for get_response table, created_at index #3389

botnumberseven opened this issue Nov 3, 2024 · 0 comments

Comments

@botnumberseven
Copy link

If get-response table gets big enough (in my case it's ~2M rows at the moment), then node falls into a restart loop as it timeouts on the query like this:
SELECT id, operation_id AS operationId, keyword, status, message, created_at AS createdAt, updated_at AS updatedAt
FROM get_response AS get_response
WHERE get_response.created_at <= '2024-11-02 15:24:39'
ORDER BY createdAt ASC LIMIT 1000;

adding index on created_at fixes the issue:
ALTER TABLE operationaldb.get_response ADD INDEX idx_created_at (created_at ASC) VISIBLE;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant