indexing on facts?

From: Chuang Liu <>
Date: Thu 02 Dec 2004 06:47:00 PM GMT
Message-ID: <>
Hi there:
I build a large set of facts about network link
between machines in internet, and want to query a
network link with particular bandwidth. Because the
performance of my implementation is very bad, can any
one help to take a look at my solution, please? Any
suggestion is appreciated.

The facts is in the format of
   band(bandwidth, host1, host2).
For example: ( 500, 1, 2) means the bandwidth between
host 1 and host 2 is 500.

I build a query for network link with bandwidth bigger
than N defined as
  find(H1, H2, T) :-
    [H1, H2] :: [ 1..300],
    nconnect(H1, H2, T),

  nconnect(H1, H2, T) :-
    band(B, H1, H2),
    B #>= T.

When I submit a query, I notice every fact is checked,
is there a way to improve it? For example, using B #>=
T and a kind of index on B of fact (B, Host1, Host2)
to filter facts with bandwidth less than T without
checking them one by one?



Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
Received on Thu Dec 02 19:06:32 2004

This archive was generated by hypermail 2.1.8 : Wed 16 Nov 2005 06:07:31 PM GMT GMT