Date: Nov 20, 2012 4:07 PM
Author: Graham Cooper
Subject: Re: PROLOG ENGINES ARE REALLLLLLY SLOW! ((SQL-UNIFY))

>
> 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