Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3670892
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T02:25:14+00:00 2026-05-19T02:25:14+00:00

Base information: This is in context to the indexing process of OpenStreetMap data. To

  • 0

Base information: This is in context to the indexing process of OpenStreetMap data. To simplify the question: the core information is divided into 3 main types with value “W”, “R”, “N” (VARCHAR(1)).

The table has somewhere around ~75M rows, all columns with “W” make up ~42M rows. Existing indexes are not relevant to this question.


Now the question itself: The indexing of the data is done via an procedure. Inside this procedure, there are some loops that do the following:

[…] SELECT * FROM table WHERE the_key = “W”; […]

The results get looped again and the above query itself is also in a loop. This takes a lot of time and slows down the process massivly. An indexon the_key is obviously useless since all the values that the index might use are the same (“W”). The script itself is running with a speed that is OK, only the SELECTing takes very long.

Do I

  • need to create a “special” kind of index that takes this into account and makes the SELECT quicker? If so, which one?
  • need to tune some of the server parameters (they are already tuned and the result that they deliver seem to be good. If needed, I can post them)?
  • have to live with the speed and simply get more hardware to gain more power (Tim Taylor grunt grunt)?

Any alternatives to the above points (except rewriting it or not using it)?

  • 1 1 Answer
  • 3 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T02:25:14+00:00Added an answer on May 19, 2026 at 2:25 am

    This query could use an index if you set work_mem high enough to enable a bitmap index scan. It’s quite possible, however, that the optimizer still won’t choose to use it. Altogether, there isn’t much to optimize about this. It looks like the surrounding looping code is in need of improvement.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My main Spring Configuration XML file specifies something like this: <context:component-scan base-package=com.application /> The
This question covncerns my lack of understanding of how to use the core data
According to this post , I am using a data context per call, so
I have a log in page that pulls information from a data base, I
I'm working on an asp.net-mvc application. The linq data context is being passed into
I've a model named GuestOrder: class GuestOrder < ActiveRecord::Base end # == Schema Information
I am reading about which is the recommended life for the data context, but
I have model with tag context: class Product < ActiveRecord::Base acts_as_taggable_on :categories end I'm
In extension to this question is there a way to obtain the effective URL
I want to instantiate a template class with data types that are available at

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.