From jan@swi.psy.uva.nl  Sat Oct 30 16:33:55 1999
Received: from gollem.swi.psy.uva.nl (root@gollem [145.18.114.15])
	by swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id QAA00393;
	Sat, 30 Oct 1999 16:33:54 +0200 (MET DST)
Received: (from jan@localhost)
	by gollem.swi.psy.uva.nl (8.9.3/8.9.3) id QAA28108;
	Sat, 30 Oct 1999 16:33:54 +0200
Date: Sat, 30 Oct 1999 16:33:54 +0200
Message-Id: <199910301433.QAA28108@gollem.swi.psy.uva.nl>
From: Jan Wielemaker <jan@swi.psy.uva.nl>
Subject: Re: indexing capabilty of swi-pl
To: prolog@gollem.swi.psy.uva.nl, s.degiorgi@tin.it
In-Reply-To: Stefano De Giorgi's message of Fri, 29 Oct 1999 23:06:14 +0200
Phone: +31 - 20 - 525 6121

> * Wich of this methods do you think is faster to access a dictionary,
>    entry(KeyValue,....KeyInfos....)   (about 5.000 entries):
>           - put entries as they are in the internal DB of Prolog (with
>             KeyValue as first argument, relaying on SWI-PL first arg
>             indexing;
>           - put entries in a B-tree managed by Prolog.
> 
> * What kind of tecnique is used to index the first arg?

This depends on the number of clauses, but using large sets the choice
is always a hash-table.  Try to avoid as much as possible duplicates
and don't use a `catch-all' clause (using a variable) at the end.
5,000 entries is just peanuts.  We've played with tables more than
10 times as big without any trouble.

	--- Jan

