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

WIP: Experimental middle implementations #1384

Closed
wants to merge 1 commit into from

Conversation

joto
Copy link
Collaborator

@joto joto commented Dec 21, 2020

This PR adds two new middle implementations:

  • db is similar to pgsql. All data is stored in the database. A new table structure with JSONB for tags and relation members
    is used.
  • mem is similar to ram. It only stores node locations and way node lists in RAM. Used for import-only workflows that do
    not need the flex-output two-stage processing.

These are EXPERIMENTAL! They are not well tested, not complete and performance might be horrible. They are intended to start a discussion about what we need and how to best implement it. This PR will evolve over time.

To enable these, set the environment variable OSM2PGSQL_MIDDLE to either db or mem. This setting is independent of the --slim setting! This way of setting the middle is temporary and gives us flexibility while experimenting, it will not be available in this form in the final implementation.

More about this on in my blog.

@joto joto marked this pull request as draft December 21, 2020 10:59
@joto joto force-pushed the wip-middle-experiments branch 3 times, most recently from 8252c36 to 7ef0214 Compare December 21, 2020 15:53
@joto joto force-pushed the wip-middle-experiments branch 3 times, most recently from b4b22b7 to 48551fa Compare April 18, 2021 09:29
@joto
Copy link
Collaborator Author

joto commented May 5, 2021

New version of this PR. The 'mem' middle has been removed, because it has been merged into master.

This commits adds a new middle implementations 'db' which is similar to
'pgsql'. All data is stored in the database. A new table structure with
JSONB for tags and relation members is used.

This is EXPERIMENTAL! Not well tested, not complete and performance
might be horrible. It is intended to start a discussion about what we
need and how to best implement it.

To enable these, set the environment variable OSM2PGSQL_MIDDLE to either
'db' or 'new'. If set to 'db' use of the new middle is forced,
independent of the '--slim' setting! Or you can set it to 'new' in which
case the 'db' middle will be used instead of the 'pgsql' middle if and
when that would have been used.

This way of setting the middle is temporary and gives us flexibility
while experimenting, it will not be available in this form in the final
implementation.

The new middle has various options that can be set with the
OSM2PGSQL_MIDDLE_OPTS environment variable. Use a comma separated list
of options, a leading '-' disables the option.

Options:
* drop_tables
* forward_dependencies
* has_bucket_index
* tags
* attributes
* untagged_nodes
* locations
* way_nodes
* relation_members
@joto
Copy link
Collaborator Author

joto commented Jan 18, 2023

osm2pgsql has changed quite a lot since this PR was made and it isn't really useful any more. Closing here. We are still planning to reintroduce something like this later.

@joto joto closed this Jan 18, 2023
@joto joto deleted the wip-middle-experiments branch January 25, 2023 13:03
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.

None yet

1 participant