-
-
Notifications
You must be signed in to change notification settings - Fork 474
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
Manual index configuration for id indexes? #1854
Comments
This is something I've run into a few times. I have ID indexes for dev work so I can fetch particular objects for testing, but have to manually create them. |
I see two possible solutions:
The first has the advantage that all indexes are in the same place but it is less obvious what it means and has some potential to be used wrongly. So I'd go for the second option. |
@pnorman This issue is specific to id indexes. If you need other indexes only in some setups you have to write your Lua script accordingly and use, for instance, an environment variable to switch between different setups. |
I am talking about ID indexes. |
I prefer option two as well. |
The problem with (2) is that you can't use the more simple For option (2), that are the values for
|
I'd go with strings |
If the user always needs the id index, they can force the index build even in non-slim (or slim+drop) mode by setting the `create_index` option of the `ids` setting in the define_table() Lua command to `always`. The default is `autpo` which means: Only build the index in slim mode. See osm2pgsql-dev#1854 The test runner (steps_db.py) has been extended so that the table_exists() check also checks for views, so that we can access the data in the pg_catalog.pg_indexes view.
This was implemented in #1894. |
I noticed a problem with the new manual index creation options as per #1780: The id indexes are explicitly exempt from the configuration. Osm2pgsql will create an id index when it needs the index itself, i.e. when it creates a database for updates. Now if the user needs an index on the id column for some other reason everything is fine as long as we are creating a database for updates, the user can just use the index osm2pgsql creates for itself. But if the database is not created for updates, the user has to add that index to the configuration. But this means the configuration depends on whether the user creates an updatable database or not which is somewhat confusing and annoying for the user, especially because there is a good chance testing is done on a non-updatable database and then the final production import is updatable and the result are two (probably even identical) indexes on the id column.
The text was updated successfully, but these errors were encountered: