AmpersandTarski / Ampersand

Build database applications faster than anyone else, and keep your data pollution free as a bonus.
http://ampersandtarski.github.io/
GNU General Public License v3.0
40 stars 8 forks source link

Performance issue of certain rule formulation #720

Open Michiel-s opened 6 years ago

Michiel-s commented 6 years ago

Given the script

RELATION prop[A] [PROP]
RELATION r[A*B] [UNI]

Evaluating the following rule performs very badly: prop |- I /\ r;('b1' \/ 'b2');r~

When removing the I /\ aspect, which keeps the same semantics because prop is a property, the rule evaluation is significantly faster. The SQL query generated for the conjunct is of course different.

Faster rule: prop |- r;('b1' \/ 'b2');r~

Michiel-s commented 6 years ago

I'm not sure (yet) if the part with singletons ('b1' \/ 'b2') is of influence

hanjoosten commented 6 years ago

Interesting. I'll have a look. FYI: be aware of the new syntax regarding singleton expressions. See issue #713 , which has been in effect since release 3.9.0