Re: Axiom queries involving Powerups
[email protected] Thu, 31 Aug 2006 16:25:47 -0400
| Newsgroups | gmane.comp.python.quotient.dev |
|---|---|
| Message-ID | <20060831202547.1717.59742927.divmod.quotient.35487@ohm> |
On Thu, 31 Aug 2006 13:48:11 -0400, Calvin Spealman <[email protected]> wrote: >Basically, you can't do joins between item types, which is what this >would boil down to in the SQL code. You can definitely do joins between item types in SQL code. It looks like this: store.query(A, AND(A.b == B.storeID, B.c == 7)) That gets all As whose 'b' attribute refers to a B which has a 'c' attribute of 7. >It hasn't been implemented that >last I looked, but maybe way down the road we will see it. This is >along the lines that you can't query for an attribute of a referenced >item. The reason you can't query for an attribute of a referenced item is that it's not clear what the type of the attribute would be. As long as the reference could be to *anything*, there's no way to express in SQL what the referent column would be (without an explosively inefficient query that would possibly generate several thousand lines of SQL to even perform). As above, if you specify the type of the referenced item, it's perfectly possible. >It could be potentially expensive, because for every row of the item >found (not using the powerup condition), you then have to search the >powerup connectors, join them with the items and the powerups, which >you also have to get. This is all correct, except you can join against the _PowerupConnector class just fine. >As I have seen, it might happen one day, but >that day isn't in sight. This obviously isn't though :) >If anything I'm saying is out of date, someone correct me. It's not out of date - this was always possible. The only new thing that was added recently was placeholder joins (which aren't necessary here).