[MonetDB-users] Problem with View definition
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
On Tue, Feb 19, 2008 at 06:52:55PM +0100, Michael Schmidt wrote:
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 );
You just found a bug in the object dependency code (this is need for example for the proper handeling of drop cascade etc). I hope we can fix it soon. Niels
Kind regards, Michael Schmidt
------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users
-- Niels Nes, Centre for Mathematics and Computer Science (CWI) Kruislaan 413, 1098 SJ Amsterdam, The Netherlands room C0.02, phone ++31 20 592-4098, fax ++31 20 592-4312 url: http://www.cwi.nl/~niels e-mail: Niels.Nes@cwi.nl
Thank you very much for the clarification and for your efforts! Please notify me as soon as the bug is fixed. Michael
You just found a bug in the object dependency code (this is need for example for the proper handeling of drop cascade etc). I hope we can fix it soon.
Niels
Kind regards, Michael Schmidt
------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users
--
Niels Nes, Centre for Mathematics and Computer Science (CWI) Kruislaan 413, 1098 SJ Amsterdam, The Netherlands room C0.02, phone ++31 20 592-4098, fax ++31 20 592-4312 url: http://www.cwi.nl/~niels e-mail: Niels.Nes@cwi.nl
------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users
On Tue, Feb 19, 2008 at 08:25:09PM +0100, Michael Schmidt wrote:
Thank you very much for the clarification and for your efforts! Please notify me as soon as the bug is fixed.
The bug in the dependency code is fixed and checked into the stable cvs branch. Niels
Michael
You just found a bug in the object dependency code (this is need for example for the proper handeling of drop cascade etc). I hope we can fix it soon.
Niels
Kind regards, Michael Schmidt
------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users
--
Niels Nes, Centre for Mathematics and Computer Science (CWI) Kruislaan 413, 1098 SJ Amsterdam, The Netherlands room C0.02, phone ++31 20 592-4098, fax ++31 20 592-4312 url: http://www.cwi.nl/~niels e-mail: Niels.Nes@cwi.nl
------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users
------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users
-- Niels Nes, Centre for Mathematics and Computer Science (CWI) Kruislaan 413, 1098 SJ Amsterdam, The Netherlands room C0.02, phone ++31 20 592-4098, fax ++31 20 592-4312 url: http://www.cwi.nl/~niels e-mail: Niels.Nes@cwi.nl
participants (2)
-
Michael Schmidt
-
Niels Nes