Well you've essentially made one with the clustering system. It works, but is prone to errors and needs constant love from the application or it gets munged up...a target for bugs, basically. If you get that "for free" with a geo plugin then you can ignore it from the app's perspective. Depends on the needs.
Pablo (and all),The reason there's a separate location table is exactly why you thought there was a location table. When Ushahidi was first being written, the idea was to reuse locations as places.The problem I think with storing all of the lat,lon data in points is it makes the queries a bit more complex, which can't be abstracted out in Kohana's ORM. From the direction this discussion is going though, it looks like some kind of support for a "geo ORM" might be necessary.BrianOn Tuesday, July 17, 2012 at 8:44 AM, Aaron Huslage wrote:
With postgis tables the Geometric types are very much more efficient in both storage and searching. GIST indexes provide a fabulous method for quick retrieval. If we could get even half of that optimization into mySQL that would be a boon.
--Aaron Huslagesent via mobile deviceI’ve been wondering that for a *long* time J My conclusion is that it’s just a legacy bit of design, where maybe the system was expecting several reports from each location, rather the more common 1-1 relationship we have now. (Original devs, you may now laugh at my conclusion…)
What I usually end up doing is storing POINT(longitude,latitude), as to work with a geometry for each location (which is to say, for each incident). So we can add to the question, why do we save lat/lon, when we could use a geometry? (and derive lat/lon as needed).
We now have one geom-enabled table, to store geometries associated with incidents. Having this optional 1-many relationship between a report and several locations could make sense.
If anyone has any info on performance of indexed geometry fields vs the traditional lat/long, please comment. I assume that for simple lookups, the floats will be faster.
Pablo
From: John Etherton [mailto:john.etherton@...]
Sent: Monday, July 16, 2012 17:12
To: developers@...
Subject: Re: [ushahidi developers] PHP/MySQL
For that matter does it make sense to store locations in separate tables from the incidents?
On 07/16/2012 05:01 PM, David Kobia wrote:
For starters,Just testing last week, I noticed quite a difference between- `longitude` float(10,6) NOT NULL DEFAULT '0',- `latitude` float(10,6) NOT NULL DEFAULT '0',and the current- `latitude` double NOT NULL DEFAULT '0',- `longitude` double NOT NULL DEFAULT '0',Doubles are twice as large and extremely wasteful. Also, there reallyisn't any need to know within a millimeter, the latitude/longitude. 6decimal places will more than suffice (XXXX.XXXXXX). Combine this withindexing and we might be getting somewhere.On Mon, Jul 16, 2012 at 6:25 PM, Pablo A. Destéfanis<pdestefanis@...> wrote:I agree with Emmanuel, and let me add:· While PostGIS is excellent, quite a lot can be done with MySQL’sspatial extensions. I don’t swear over it, but the complexity of porting theapp needs to be weighed against the limitations (also known as the “how manyppl would need it”).· If you have a big site, you can always offload your data to yourDB of choice. To me that is part of the “a factory installation won’t cutit”· Not sure how the NoSQL option will.· I do not have info on slow queries with me, but I’m sure codecould be tightened. While I can’t point to examples, I do recall this fromlooking at several query-logs in MySQL.Last, if anyone is interested in testing this, I would love to stay intouch.Cheers,PabloFrom: Emmanuel Kala [mailto:emkala@...]Sent: Monday, July 16, 2012 14:50To: developers@...Subject: Re: [ushahidi developers] PHP/MySQLSome notes:Scale is a function of designMySQL scales quite well...when you know what you're doing but it's not veryinspiring for geo-spatial work. PostgreSQL (+PostGIS) has clearly become thepreferred choice for such.For high traffic deployments, a factory installation won't cut it - someload balancing, caching, DB tuning etc work has to be done in addition toexorcising ghosts that are always inherent in the machineThe NoSQL options, e.g. Redis, are pretty good for caching (Reddit and bigxxx sites)Profiling code has provided great insights on what sections of theapplication are yielding beastly load timesThanks.On Mon, Jul 16, 2012 at 10:59 PM, João Peixoto <joao.mpfp@...> wrote:Hello all,First post here, not really an Ushahidi developer yet, for the moment theNGO I work with has a couple projects that use it and since we love it,we're starting customization to meet our needs (which differ a bit from thetypical Crwodmap sites - it's a biking support site).On Mon, Jul 16, 2012 at 4:51 PM, David Kobia <david@...> wrote:[...]An option might be to ensure that database interaction is abstractedenough that it doesn't matter what the underlying database is... andthis is something that might be worth looking into.I'd love to see some DB abstraction on Ushahidi. If possible, have a "quickand dirty" approach using mysql that allows a quick deployment, but as asite scales up and requires further optimizations, allow better back-endsfor efficiency.My 2 cents!JP--Kind Regards,Emmanuel KalaSkype: emmanuel.kalaJudgement comes from experience, experience comes from poor judgement~~~~~~~~~~~~~~~~~~~~~~~~~~List Archive: http://list.ushahidi.com/Would you like to receive list mail batched in a daily digest instead? Send a message to:developers-digest-subscribe@...To remove your address from the list, just send a message tothe address in the "List-Unsubscribe" header of any listmessage. If you haven't changed addresses since subscribing,you can also send a message to:developers-unsubscribe@...For addition or removal of addresses, we'll send a confirmationmessage to that address. When you receive it, simply reply to itto complete the transaction.If you need to get in touch with the human owner of this list,please send a message to:developers-owner@...