Giter VIP home page Giter VIP logo

Comments (5)

jeffjanes avatar jeffjanes commented on July 21, 2024

What if you lower work_mem just in the session that is doing the updates?

from osm2pgsql.

pnorman avatar pnorman commented on July 21, 2024

What if you lower work_mem just in the session that is doing the updates?

I'm not sure - if there's any sorts or bitmap scans being done, it'll have negative impacts there.

from osm2pgsql.

jeffjanes avatar jeffjanes commented on July 21, 2024

Do you have a specific use case in mind? e.g. an example command line to use?

There is a proposed change in PostgreSQL to allow the fast update pending list to be set separately from work_mem (https://commitfest.postgresql.org/action/patch_view?id=1536). I tried testing it with various settings that I thought were reasonable, but I couldn't find meaningful improvement, because it seems like the pending list wasn't much of a bottleneck.

But I only tried initial loads, not incremental loads, because that is what I am familiar with.

from osm2pgsql.

pnorman avatar pnorman commented on July 21, 2024

Do you have a specific use case in mind?

The current reason we can't use fastupdate is that with the high work_mem required on a rendering server the pending-entry list grows very large, and updates become extremely slow because scanning a 128MB pending-entry list is slow.

Ideally, we'd keep the pending list small, and after an osm2pgsql command has completed, force it to process the pending list, even if it's small.

This won't impact imports at all, because the GIN index isn't created until the very end and no updates occur to that table after the index is created. That column also isn't used in importing at all, just populated.

e.g. an example command line to use?

Just normal slim mode updates.

from osm2pgsql.

pnorman avatar pnorman commented on July 21, 2024

Ideally, we'd keep the pending list small, and after an osm2pgsql command has completed, force it to process the pending list, even if it's small.

And with 9.6 we will have a way to do this!

My thoughts are

  • Detect PostgreSQL version
  • On 9.6 create GIN indexes with fastupdate on
  • On 9.6 when finishing processing during updates run gin_clean_pending_list

If running on a DB created by an earlier osm2pgsql version (with fastupdate=off indexes) this would still work because gin_clean_pending_list can still be safely called.

The migration is also easy.

from osm2pgsql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.