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

pgdate: pgdate.ParseDate allocates a lot of temporary heap memory #91834

Closed
cucaroach opened this issue Nov 14, 2022 · 0 comments · Fixed by #92252
Closed

pgdate: pgdate.ParseDate allocates a lot of temporary heap memory #91834

cucaroach opened this issue Nov 14, 2022 · 0 comments · Fixed by #92252
Assignees
Labels
C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-sql-queries SQL Queries Team

Comments

@cucaroach
Copy link
Contributor

cucaroach commented Nov 14, 2022

The fieldExtract struct escapes to the heap and the textChunks and numbers slices in fieldExtract.Extract are allocated every time, pulling these allocations into a reusable struct that can be passed to ParseDate would greatly speed up date parsing.

Jira issue: CRDB-21450

@cucaroach cucaroach added the C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) label Nov 14, 2022
@cucaroach cucaroach self-assigned this Nov 14, 2022
@blathers-crl blathers-crl bot added the T-sql-queries SQL Queries Team label Nov 14, 2022
craig bot pushed a commit that referenced this issue Nov 29, 2022
92252: copy: optimize date parsing memory usage r=cucaroach a=cucaroach

- pgdate: benchmark ParseDate
- pgdate: optimize bulk date parsing
- sql: wire up pgdate optimization to ParseAndRequireString and colexec.

Fixes: #91834

I'll squash the last two commits but thought for review purposes they'd be better separate.

Epic: CRDB-18892


Co-authored-by: Tommy Reilly <[email protected]>
@craig craig bot closed this as completed in 048f833 Nov 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-sql-queries SQL Queries Team
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant