Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » sci.math.* » sci.math.independent

Topic: PROLOG ENGINES ARE REALLLLLLY SLOW! ((SQL-UNIFY))
Replies: 5   Last Post: Nov 20, 2012 4:40 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Graham Cooper

Posts: 4,253
Registered: 5/20/10
Re: PROLOG ENGINES ARE REALLLLLLY SLOW! ((SQL-UNIFY))
Posted: Nov 20, 2012 4:07 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

>
> SQL-UNIFY
> SELECT * FROM TTAILS, TPRO
> WHERE TTAILS.REF = TPRO.REF
> AND TTAILS.FIELD = TPRO.FIELD
> ORDER BY TPRO.ID
>


The result SQL Join will look like this.

FACT
vert( pnt(X,Y) (pnt(X,Z)). //TPRO.ID = 21

QUERY
?- vert( pnt(1,2) (X,Y)). //TTAIL.ID = 1 (2 vars
substituted)


T.ID T.REF T. FLD T.TYP P.ID P.REF P.FLD
========================================
1 1 vert H 21 1 vert
1 2 pnt P 21 2 vert
1 3 pnt P 21 3 pnt
1 21 1 T 21 21 1
1 22 2 T 21 22 2

The Matched Rule 21 would then have to be fetched for all other rows
(VARS).

Herc



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.