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 8550885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:04:03+00:00 2026-06-11T14:04:03+00:00

I have lat/lon coordinates in a 400 million rows partitioned mysql table. The table

  • 0

I have lat/lon coordinates in a 400 million rows partitioned mysql table.
The table grows @ 2000 records a minute and old data is flushed every few weeks.
I am exploring ways to do spatial analysis of this data as it comes in.

Most of the analysis requires finding whether a point is in a particular lat/lon polygon or which polygons contain that point.

I see the following ways of tackling the point in polygon (PIP) problem:

  1. Create a mysql function that takes a point and a Geometry and returns a boolean.
    Simple but not sure how Geometry can be used to perform operations on lat/lon co-ordinates since Geometry assumes flat surfaces and not spheres.

  2. Create a mysql function that takes a point and identifier of a custom data structure and returns a boolean.
    The polygon vertices can be stored in a table and a function can compute PIP using spherical math. Large number of polygon points may lead to a huge table and slow queries.

  3. Leave point data in mysql and store polygon data in PostGIS and use the app server to run PIP query in PostGIS by probviding point as a parameter.

  4. Port the application from MySQL to Postgresql/PostGIS.
    This will require a lot of effort in rewriting queries and procedures.
    I can still do it but how good is Postgresql at handling 400 million rows.
    A quick search on google for “mysql 1 billion rows” returns many results. same query for Postgres returns no relevant results.

Would like to hear some thoughts & suggestions.

  • 1 1 Answer
  • 0 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-06-11T14:04:05+00:00Added an answer on June 11, 2026 at 2:04 pm

    A few thoughts.

    First PostgreSQL and MySQL are completely different beasts when it comes to performance tuning. So if you go the porting route be prepared to rethink your indexing strategies. Not only does PostgreSQL have a far more flexible indexing than MySQL, but the table approaches are very different also, meaning the appropriate indexing strategies are as different as the tactics are. Unfortunately this means you can expect to struggle a bit. If i could give advice I would suggest dropping all non-key indexes at first and then adding them back sparingly as needed.

    The second point is that nobody here can likely give you a huge amount of practical advice at this point because we don’t know the internals of your program. In PostgreSQL, you are best off indexing only what you need, but you can index functions’ outputs (which is really helpful in cases like this) and you can index only part of a table.

    I am more a PostgreSQL guy than a MySQL guy so of course I think you should go with PostgreSQL. However rather than tell you why etc. and have you struggle at this scale, I will tell you a few things that I would look at using if I were trying to do this.

    • Functional indexes
    • Write my own functions for indexes for related analysis
    • PostGIS is pretty amazing and very flexible

    In the end, switching db’s at this volume is going to be a learning curve, and you need to be prepared for that. However, PostgreSQL can handle the volume just fine.

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

Sidebar

Related Questions

I have a table with lon/lat coordinates What I need is to get users
I have a three lat-lon coordinates that make up two line segment A to
I have a mysql MyISAM table with many rows that contain information about places,
I have a Django application which takes the lat/lon from a user's coordinates via
I have a list of coordinates of lat/lon values consisting of cities around the
I have a large collection of pictures with GPS locations, encoded as lat/lon coordinates,
I have several file with the following format: lat,lon,value. I would like to plot
I have the following code but the lon/lat seems to be returning null; package
I have 3 points ( lat , lon ) that form a triangle.How can
i have a function to calculate several different values: int ASPfile::get_dimensions(int* Lat, int* Lon,

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.