Skip to content

Check if way-node index exists before enabling forward dependencies #1814

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

Closed
lonvia opened this issue Nov 4, 2022 · 3 comments
Closed

Check if way-node index exists before enabling forward dependencies #1814

lonvia opened this issue Nov 4, 2022 · 3 comments

Comments

@lonvia
Copy link
Collaborator

lonvia commented Nov 4, 2022

If a database is imported with --with-forward-dependencies=false and then updated without the option, updates will be slow to the point of being unusable because the way-node index is missing.

osm2pgsql should check that the index exists before allowing forward dependencies.

Related to #1311.

@joto
Copy link
Collaborator

joto commented Nov 4, 2022

We don't have the name of the index, but this should probably work:

SELECT count(*) FROM pg_indexes WHERE tablename='{prefix}ways' AND indexdef LIKE '%nodes%';

If the result is >0, the index is there.

@joto
Copy link
Collaborator

joto commented Jan 4, 2023

Do we need this check now that --with-forward-dependencies is going away anyway?

See #1866 .

@lonvia
Copy link
Collaborator Author

lonvia commented Jan 4, 2023

Nope.

@lonvia lonvia closed this as completed Jan 4, 2023
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

2 participants