
Hi, I am running the latest (February) release of MonetDB, and I have a question concerning MonetDB view definitions. I have defined a schema consisting of simple triple-column tables, defined as follows CREATE TABLE bench_booktitle (subject INTEGER,object INTEGER,FOREIGN KEY (subject) REFERENCES Dictionary(ID),FOREIGN KEY (object) REFERENCES Dictionary(ID)); CREATE TABLE bench_cdrom (subject INTEGER,object INTEGER,FOREIGN KEY (subject) REFERENCES Dictionary(ID),FOREIGN KEY (object) REFERENCES Dictionary(ID)); ... using a simple Dictionary lookup table CREATE TABLE Dictionary (ID INTEGER,val VARCHAR(20000),PRIMARY KEY (ID)); Now, I'm trying to create a view ranging over all these tables. The problem with the view definition is that it takes a very long time and consumes large main memory resources (I aborted after 10 minutes, where the mserver5 process uses more than 1.2GB of main memory). It might be of interest that view creation takes place even before loading any data in the tables, i.e. all tables are empty. Maybe someone has an idea what's going on when creating the View. Why does it require so much memory and why does it take so long? Any idea how to fix this problem? Here is the view definition (which is rather straightforward): CREATE VIEW Triples AS ( SELECT subject,'bench:booktitle' AS predicate,object FROM bench_booktitle ) UNION ( SELECT subject,'bench:cdrom' AS predicate,object FROM bench_cdrom ) UNION ( SELECT subject,'swrc:pages' AS predicate,object FROM swrc_pages ) UNION ( SELECT subject,'foaf:homepage' AS predicate,object FROM foaf_homepage ) UNION ( SELECT subject,'swrc:editor' AS predicate,object FROM swrc_editor ) UNION ( SELECT subject,'swrc:number' AS predicate,object FROM swrc_number ) UNION ( SELECT subject,'dc:creator' AS predicate,object FROM dc_creator ) UNION ( SELECT subject,'rdfs:seeAlso' AS predicate,object FROM rdfs_seeAlso ) UNION ( SELECT subject,'dcterms:partOf' AS predicate,object FROM dcterms_partOf ) UNION ( SELECT subject,'dcterms:references' AS predicate,object FROM dcterms_references ) UNION ( SELECT subject,'dcterms:issued' AS predicate,object FROM dcterms_issued ) UNION ( SELECT subject,'swrc:volume' AS predicate,object FROM swrc_volume ) UNION ( SELECT subject,'dc:publisher' AS predicate,object FROM dc_publisher ) UNION ( SELECT subject,'swrc:note' AS predicate,object FROM swrc_note ) UNION ( SELECT subject,'swrc:chapter' AS predicate,object FROM swrc_chapter ) UNION ( SELECT subject,'swrc:address' AS predicate,object FROM swrc_address ) UNION ( SELECT subject,'swrc:series' AS predicate,object FROM swrc_series ) UNION ( SELECT subject,'swrc:month' AS predicate,object FROM swrc_month ) UNION ( SELECT subject,'foaf:name' AS predicate,object FROM foaf_name ) UNION ( SELECT subject,'rdf:type' AS predicate,object FROM rdf_type ) UNION ( SELECT subject,'dc:title' AS predicate,object FROM dc_title ) UNION ( SELECT subject,'swrc:journal' AS predicate,object FROM swrc_journal ) UNION ( SELECT subject,'bench:abstract' AS predicate,object FROM bench_abstract ) UNION ( SELECT subject,'swrc:isbn' AS predicate,object FROM swrc_isbn ); Kind regards, Michael Schmidt