MySql or other database libraries ideal for my problem?

Hello there.
So, I am playing around a bit with 3D objects on openGL and parsing then and all, and I got a bit of a situation.
I just need to know if MySql is the way to go here.
I can generate a list of XYZ points on a txt file, each with its own index, like
<index> <x> <y> <z>
<index> <x> <y> <z>
<index> <x> <y> <z>
...
where each point in unique
Anyway, I need a quick way to give a xyz coordinate and have some function and something return me it's ID (or even saying if the point is on the list), cuz just scanning the file for each point wont cut it, some have millions of points.
I was recommended a database library like MySql... I just don't know the first thing about it. Would it help me locate the ID of a point or the point of an ID more quickly?
And is MySql the best (and simplest) to use?
I run a Ubuntu 14.04 - 4Gb and 16.04 - 12Gb(eventually).
Thank you very much!
Last edited on
Are the coordinates floats? Do you want an exact match, or a nearest neighbor?
How many millions are we talking about? 10M instances of struct{ uint32_t; float[3]; } would only use around 160 MiB, which can easily fit in RAM.
Last edited on
Yes, the coordinates are double, but only need to be precise to the 9th decimal place (preheat float'd be better)
The number Is very arbitrary, as I increase the precision of my program the more points there'd be, and depending on the instance and precision of the program it'd certainly go beyond my avaliable ram, that's why I started using files.
I have the points as a class, and even if I save an array of them, it would allow me to find the points giving the Id but not the id giving the point, which is what I need.
Thank you.
Last edited on
AFAIK, no. MySQL does not do spacial queries. PostGIS, which appears to be an add-on of sorts to PostgreSQL, apparently does.

https://en.wikipedia.org/wiki/Spatial_database
closed account (48T7M4Gy)
http://www.boost.org/doc/libs/1_59_0/libs/bimap/doc/html/boost_bimap/one_minute_tutorial.html
Topic archived. No new replies allowed.