[
https://issues.apache.org/jira/browse/MARMOTTA-175?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13615038#comment-13615038
]
Sebastian Schaffert commented on MARMOTTA-175:
----------------------------------------------
Hi Raffaele, thanks for the work you did. The delete query is currently
constructed automatically by the triple store (you might have found the source
code locations already).
What I am not sure about is the efficiency of the query you provide. I think I
read somewhere that a join with a union subselect can be very expensive in
MySQL, especially since you are listing all ids in the union subquery. Did you
try this out on larger data sets (e.g. import some 30.000 triples or so to
test)?
Another solution I was thinking about was to build the delete query like this:
DELETE FROM triples WHERE
triples.deleted = true
AND
NOT EXISTS (SELECT triple_id FROM reasoner_just_supp_triples WHERE triple_id =
triples.id)
AND
NOT EXISTS (SELECT triple_id FROM versions_added WHERE triple_id = triples.id)
AND
NOT EXISTS (SELECT triple_id FROM versions_removed WHERE triple_id = triples.id)
> Garbage collection on triple tables
> -----------------------------------
>
> Key: MARMOTTA-175
> URL: https://issues.apache.org/jira/browse/MARMOTTA-175
> Project: Marmotta
> Issue Type: Bug
> Components: Triple Store
> Affects Versions: 3.1-incubating
> Environment: Centos 6.4 64b - JDK 1.6.0_38 - MySql 5.1.67 - Tomcat
> 7.0.37
> Reporter: Raffaele Palmieri
> Assignee: Sebastian Schaffert
> Priority: Minor
> Labels: garbage, mysql, triplestore
>
> During garbage collection of triple tables in log there is the following line:
> SQL error while executing garbage collection on triples table: You have an
> error in your SQL syntax; check the manual that corresponds to your MySQL
> server version for the right syntax to use near 'UNION (SELECT triple_id FROM
> reasoner_just_supp_triples WHERE triple_id = triple' at line 1
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira