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

Slow query in update of slopes view #6

Open
lonvia opened this issue Dec 30, 2021 · 0 comments
Open

Slow query in update of slopes view #6

lonvia opened this issue Dec 30, 2021 · 0 comments

Comments

@lonvia
Copy link
Contributor

lonvia commented Dec 30, 2021

The following query causes the occasional problems:

2021-12-28 11:04:44.629 CET [56297] wmt@planet LOG:  duration: 129114.189 ms  statement: INSERT INTO slopes.slopeways_view (id, tags, nodes) SELECT ways.id, ways.tags, ways.nodes 
        FROM ways 
        WHERE ways.id IN (SELECT way_changeset.id 
        FROM way_changeset 
        WHERE way_changeset.action != 'D') AND 
            tags ? 'piste:type'
            AND NOT (tags ? 'state' AND tags->>'state' = 'proposed')
            AND NOT (tags->>'piste:type' = 'downhill'
                     AND nodes[array_lower(nodes,1)] = nodes[array_upper(nodes,1)])
            AND NOT (tags->>'piste:type' = 'skitour') AND id NOT IN (SELECT slopes.way_relations.id 
        FROM slopes.way_relations) ON CONFLICT (id) DO UPDATE SET tags = EXCLUDED.tags, nodes = EXCLUDED.nodes RETURNING slopes.slopeways_view.id
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

No branches or pull requests

1 participant