How to stop imposm3 from creating an index osm_*_geomon on geometry?

I’m using imposm3 to import buildings into postgis. I’m planning to import the whole world. Now it seems like imposm3 automatically creates a gist index called “osm_buildings_geom” on my buildings import. I have the feeling that it slows down the import. I don’t even need that index. Is there a way to stop imposm3 from doing that?

Here’s my mapping.yml for reference

---
tables:
  buildings:
    type: polygon
    columns:
    - name: osm_id
      key: 
      type: id
    - name: geometry
      key: 
      type: geometry
    - name: name
      key: name
      type: string
    - name: type
      key: building
      type: string
    - name: housenumber
      key: addr:housenumber
      type: string
    - name: street
      key: addr:street
      type: string
    - name: city
      key: addr:city
      type: string
    - name: postcode
      key: addr:postcode
      type: string
    - name: country
      key: addr:country
      type: string
    mapping:
      building:
      - __any__
    filters:
      building:
      - ruins
      - tent
      - roof
      - greenhouse
      - garages
      - garage
      - carport

you can modify the source code - removing the gist index creation.

sql := fmt.Sprintf(`CREATE INDEX "%s_geom" ON "%s"."%s" USING GIST ("%s")`,
1 Like

If that’s an option for you, you could switch to osm2pgsql which allows fine-grained control over which indexes are created.

1 Like