[m-users.] explaining index use

Dirk Ziegemeyer dirk at ziegemeyer.de
Fri Jul 22 19:23:19 AEST 2016


>>> Tomas wrote:
>>> 
>>> "As nobody else has replied, I offer my suggestion: forget about fact tables and write your own indexing code."
>>> 
>> Ok, thanks for the reality check.  I thought I must be doing something wrong with the fact table feature.   Also, besides the C compiler time and memory cost (which I could absorb), having many-way indexing of the fact table (many modes) seems to get slower in a worse than linear way. It doesn't even get to producing the C code for a many hours.
> 
> My experience with large fact tables is that they should be read at runtime with io.read instead of compiling them into the application. Thomas provided an example in this thread:
> http://lists.mercurylang.org/archives/users/2015-February/007861.html
> 
> If you still want to read the fact table at compile time, Mercury offers the feature ":- pragma fact_table", which speeds up compilation time significantly but has other drawbacks and as far as I remember is planned to be marked as deprecated.

PS:
If you just need to read a large and unstructured table at runtime, you might also consider to use the Mercury CSV module (https://github.com/juliensf/mercury-csv).

You can use io.read to load structured terms and mercury-csv to load plain table records.


More information about the users mailing list