CraueGeoBundle icon indicating copy to clipboard operation
CraueGeoBundle copied to clipboard

Performance comparison

Open weyandch opened this issue 12 years ago • 12 comments

Heya craue,

i've just installed the bundle (Doctrine 2.1.7) and made a few tests. The Queries i'm executing contain 2 joins and are performing much slower than before.

Adding indices on my "poi" table improved performance a little bit (<10%) ... going to try adapting the model to use the long/lat. query, but any hint on the most performant version would be nice in the docs.

-chris

weyandch avatar Aug 05 '12 19:08 weyandch

To be honest, I haven't done any performance-related tests yet. There are no "tests" at all. ;) Would be nice to have them, though. But what does "much slower" mean in this case?

craue avatar Aug 06 '12 13:08 craue

Okay hehe..

in the specific case i'm retrieving objects from a table, where i need to join another one which holds location & zip codes..

The query without restricting results by the GEO-Query takes 1-2ms, the one with geo data 150-170. The amount of data is little, just 5 records so far..

weyandch avatar Aug 07 '12 16:08 weyandch

That's pretty much indeed. Does your joined table have an index for location and zip code?

craue avatar Aug 08 '12 18:08 craue

Yeah, added an combined index on both fields, increased performance.. but the 150-170ms got this index already.

I'll try to do some query analysis ont he weekend, didn't find the time to investigate it further .. sorry :(

weyandch avatar Aug 10 '12 07:08 weyandch

@weyandch: Any news on this?

craue avatar Mar 11 '13 16:03 craue

/ping @weyandch

craue avatar Oct 24 '13 19:10 craue

heya, no news on that.. never continued work on that project i used your bundle on, might find some time on the holidays. will give it a try someday, sorry for not providing more help :(

weyandch avatar Oct 24 '13 19:10 weyandch

Have you found any solution? Looking around I found this: http://tr.scribd.com/doc/2569355/Geo-Distance-Search-with-MySQL starting on page 10. Does see also table of comparative performance and sounds great!

Do you think there is any way to implement this solution?

lughino avatar Nov 18 '13 14:11 lughino

:+1:

Nice catch @Lughino !

webdevilopers avatar Nov 21 '14 10:11 webdevilopers

This bundle provides doctrine functions which can be used in a query, while the optimization mentioned in the presentation (which I've also taken the formula from when creating the bundle) works by adding conditions to the WHERE part of that query, so I have no way to add them automatically when invoking one of the functions. But you could (or even should) add them yourself.

craue avatar Aug 24 '15 07:08 craue

I've added the optimization to the test suite in 15fca003d1ec140799b550d4898520f0c1134143 to show how it could be done.

craue avatar Aug 24 '15 13:08 craue