Closed cbbrowne closed 12 years ago
Did similar to in_range_ship()
https://github.com/cbbrowne/Schemaverse/commit/4efb9186b18e1e68e4e1eb56cf50686ecb5ac8ac
Man... Chris.
I don't contribute much to Schemaverse anymore but I read every update that comes in.
I have learned so much about performance optimization by reading your commits and emails.
I know contributing to any open source project is usually a thankless job. I've got a small opportunity to change that here.
Thanks, Chris, for teaching me your secretz. I really do get value from reading your contributions and figured a great gift in return would be a smile and the rosy satisfaction that you're helping random strangers learn more details about Postgres.
Keep on Schemaversing,
Sent from my mobile device
On 2012-04-02, at 18:49, Christopher Browne reply@reply.github.com wrote:
https://github.com/cbbrowne/Schemaverse/commit/747a405b945c278146807c0b764ecd5026b2fc5e
I suggest cherry-picking this, or similar.
- There's no reason to be doing a COUNT(*) when checking to see if a ship is in range of a planet.
- Shifted to plsql, as that allows the query to be expanded more intelligently by the parser when used rather than it being forcibly hidden inside the function.
Reply to this email directly or view it on GitHub: https://github.com/Abstrct/Schemaverse/issues/19
Looks great! I added them both to the master code base. The only thing I changed was the range check. I have some new indexes that these can utilize to speed things up a bit further: CIRCLE(ship.location, ship.range) @> CIRCLE(ship2.location,1)
Glad to be of service!
I wonder if that's part of what got the fleets back to running within the appointed time...
https://github.com/cbbrowne/Schemaverse/commit/747a405b945c278146807c0b764ecd5026b2fc5e
I suggest cherry-picking this, or similar.