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

libpqxx: cache column names #383

Merged
merged 2 commits into from
Apr 7, 2024
Merged

Conversation

mmd-osm
Copy link
Collaborator

@mmd-osm mmd-osm commented Apr 7, 2024

From libpqxx docs:

pqxx::field pqxx::row::at (const char f[]) const
Warning: This is much slower than indexing by number, or iterating.

Without caching, we're repeatedly calling PQfnumber for each row/field, which does a strcmp across all column names. Since our queries don't return a huge number of columns, this was not too bad before.

mmd-osm added 2 commits April 7, 2024 11:07
From libpqxx docs:
pqxx::field pqxx::row::at (const char f[]) const
Warning: This is much slower than indexing by number, or iterating.
@mmd-osm mmd-osm merged commit f3a94a3 into zerebubuth:master Apr 7, 2024
5 checks passed
@mmd-osm mmd-osm added this to the v0.9.1 milestone Apr 12, 2024
@mmd-osm mmd-osm deleted the patch/pqfnumber branch July 13, 2024 08:16
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

Successfully merging this pull request may close these issues.

1 participant