Frequently Asked Questions (and answers)
Version info: FAQ,v 1.203 2001/04/26 12:50:18 rleyton Exp

1. Operations in LEAP

Q1.1 How to list the attributes of a relation?

Use the 'describe' command, eg. 'describe leaprel' returns:

Type        Sz. Name
----------- --- ----------
STRING      25  NAME                      
STRING      25  FNAME                     
BOOLEAN     1   TEMP                      
INTEGER     4   NOATTRIBS                 
BOOLEAN     1   UPDATED                   
BOOLEAN     1   SYSTEM                    
Relation leaprel returned.

Q1.2 Why doesn't 'join (relation1) (relation2)' operator work (as expected)?

Joins require conditions. Fundamentally a join is a product 
followed by a select. The full form of a join is thus:

join (rel) (rel) (condition)

LEAP will (normally) look in two places for a condition - the
first is the command line, and each expression must by enclosed
in brackets. Values must be enclosed in quotes, eg.

join (rel1) (rel2) (rel1.attrib=rel2.attrib)
join (rel1) (rel2) ((rel1.attrib=rel2.attrib)and(rel2.attrib='2'))

If a condition is not specified, LEAP will look in the relship 
relation, which has eight attributes: 

frelation - 'foreign' relation
prelation - 'primary' relation
fkey[1-3] - 'foreign' relation attributes 1, 2 and 3
pkey[1-3] - 'primary' relation attributes 1, 2 and 3

Essentially, specify the primary key and it's attributes,
and the foreign key and it's attributes. For example, the
LEAP system relation 'leapattributes' contains an attribute
'RELATION' which is a relation name. This is the foreign key,
to the primary key 'NAME' in the relation 'leaprel'.

'leapattributes' defines all the attributes in a relation 
and 'leaprel' defines all the relations in a database.

By referencing the relship table, the join operator can derive
the condition automatically, ie.

((leaprel.NAME=leapattributes.RELATION))

There is a third method LEAP will use, and this occurs only
if no condition can be derived from the command line, or the
productjoin status is set on (or --product-join is specified
on the shell command prompt). In this scenario, LEAP will
emulate SQL behaviour, which is to perform a simple 'PRODUCT'
on the two relations specified (ie. the product, without the
join).

Q1.3 Why are temporary relations always deleted?

Temporary relations are (by default) always deleted to remove
the clutter from the database. If this is not acceptable, you can
do one of two things:

a) Set the temporary setting 'off' - temporary indicates whether
temporary relations are to be deleted. By default it is on.

b) Change the status - 'change relation' - This will update the
temporary status of a relation such that it is a permanent relation.

2. Compilation issues

Q2.0 How do I compile in the readline libraries?

LEAP supports the readline libraries if they are installed. The readline
libraries allow command line history and command editing. Versions 2.0 and
2.1 are known to work. 

Unlike many packages, the readline libraries are *NOT* included in the LEAP
default distribution. See http://www.gnu.org for a copy.

In order to compile LEAP with the readline libraries, run configure with
--with-readline, and set CPPFLAGS to include the include PATH (and -I flag). 
Sun systems (and others) will also need LD_LIBRARY_PATH to be set:

eg. if the readline libraries are included in /usr/local/include (and you're
using a bourne (sh) compatible shell:

cd src
./configure --with-readline
CPPFLAGS=-I/usr/local/include
export CPPFLAGS
make depend
make

csh users: setenv CPPFLAGS -I/usr/local/include

Sun users: LD_LIBRARY_PATH /usr/local/lib

Linking with incorrect library search path will fail. If LD_LIBRARY_PATH 
is not supported, you may need to edit LDFLAGS to include: -L<path> - 
with <path>  being the path to the libraries.

Q2.1 How do I disable debugging?

Debugging requires a particular function (do_debug) to be called at various
points in the code. Even when the debug level is 0 (no debugging), this still
eats CPU cycles. If you're not keen to have this time wasted, run configure
with --disable-debug, and recompile. This option can be added with others.

NB - The CPU time used is not huge, certainly compared to disk i/o.
