osm2pgsql-dev / osm2pgsql

OpenStreetMap data to PostgreSQL converter
https://osm2pgsql.org
GNU General Public License v2.0
1.5k stars 474 forks source link

Deprecating -i,--tablespace-index? #2133

Closed joto closed 8 months ago

joto commented 9 months ago

I think we should deprecate the option -i,--tablespace-index. It is probably seldomly used and interacts in weird ways with the other "tablespace options"

Tablespace options:
  -i,--tablespace-index TBLSPC        Tablespace for indexes (sets default for --tablespace-(main|slim)-index).
  --tablespace-main-data TBLSPC       Tablespace for main tables.
  --tablespace-main-index TBLSPC      Tablespace for main indexes.
  --tablespace-slim-data TBLSPC       Tablespace for slim mode tables.
  --tablespace-slim-index TBLSPC      Tablespace for slim mode indexes.

We have a strange mixture here of tablespaces for "tables vs. indexes" and "main (ie. pgsql output) vs. slim (ie. middle)". If we deprecate the -i,--tablespace-index we don't loose any functionality, but separate out the different concerns. We can remove the option then in 2.0.

We can also think about renaming the options --tablespace-slim-* to --midde-tablespace-* for consistency with the other middle options.

@lonvia @pnorman What do you think?

pnorman commented 9 months ago

I'm fine with deprecating it.

hholzgra commented 9 months ago

I used it back when SSDs on hosted boxes were small, having indexes on SSD only and the rest still on "rotating rust" aka classic HDDs.

But that was many, many years ago already so I won't miss it at all if it were removed

mboeringa commented 9 months ago

I used it back when SSDs on hosted boxes were small, having indexes on SSD only and the rest still on "rotating rust" aka classic HDDs.

But that was many, many years ago already so I won't miss it at all if it were removed

@hholzgra. If I understand @joto well, the discussion here is only to remove the first -i,--tablespace-index option, not the four other options, so it will still be possible to separate out the tablespaces used for indexes from the ones for tables. Of course, once pgsql output is finally put to rest in osmpgsql, only two options for "slim a.k.a. middle" remain, further cleaning up the different options.

I do use the "slim" tablespaces options, and do think there is still some limited value for being able to separate out the tablespace for indexes versus the tables they are associated with.

joto commented 9 months ago

@mboeringa Exactly right. I am only trying to clean up the command line options bit by bit, I don't want to take away any functionality. Most users will never fiddle around with tablespaces, but there will always be cases where you need them and we will continue to support them.

lonvia commented 9 months ago

I suspect that the option is used rarely enough that it doesn't make much of a difference to remove the -i option. Nominatim does offer to configure tablespaces but only in the fine grained version.

On the other hand, I don't see that keeping it adds much confusion either. It may be a bit tricky in the implementation but the semantics are clear regarding the interaction with the fine-grained parameters.