[ https://issues.apache.org/jira/browse/JENA-2177?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17424500#comment-17424500 ]
Andy Seaborne commented on JENA-2177: ------------------------------------- The update has a cross product expansion: each "where" row will have all of ?p0...?p12 ?o0 ?o12 is every combination. Write the update as specific deletes and combine into one request: (note the {{;}} separator) {noformat} DELETE { <http://www.abc.org/2147502238> ?p0 ?o0 . } WHERE { <http://www.abc.org/2147502238> ?p0 ?o0 . } ; DELETE { <http://www.abc.org/2147502239> ?p1 ?o1 . } WHERE { <http://www.abc.org/2147502239> ?p1 ?o1 . } ; ... DELETE { <http://www.abc.org/2147502250> ?p12 ?o12 . } WHERE { <http://www.abc.org/2147502250> ?p12 ?o12 . } {noformat} or using a short form: {noformat} DELETE WHERE { <http://www.abc.org/2147502238> ?p0 ?o0 . } ; DELETE WHERE { <http://www.abc.org/2147502239> ?p1 ?o1 . } ; ... DELETE WHERE { <http://www.abc.org/2147502250> ?p12 ?o12 . } {noformat} or if you know the property and object use {{DELETE DATA}}. > The execution of DELETE has extraordinary large latency and RAM > --------------------------------------------------------------- > > Key: JENA-2177 > URL: https://issues.apache.org/jira/browse/JENA-2177 > Project: Apache Jena > Issue Type: Bug > Components: ARQ > Affects Versions: Jena 4.0.0 > Environment: Windows 10 > jdk1.8.0_181 > jre1.8.0_261 > IDE : Eclipse Photon Release (4.8.0) > It occurs in multiple environments. > Reporter: Hemant Tiwari > Priority: Major > > Hi, > Issuing a DELETE with 10+ WHERE clauses has a lot of execution latency. > Reproduction Route : > 1. Insert a small amount of data (~ 50 Statements) > 2. Issue a DELETE with ~ 15 clauses. > Observation: > The execution of DELETE has extraordinary large latency and RAM. > Example of DELETE Query used: > {code:java} > String deleteQuery = "DELETE {\n" + > " <http://www.abc.org/2147502238> ?p0 ?o0 .\n" + > " <http://www.abc.org/2147502239> ?p1 ?o1 .\n" + > " <http://www.abc.org/2147502240> ?p2 ?o2 .\n" + > " <http://www.abc.org/2147502241> ?p3 ?o3 .\n" + > " <http://www.abc.org/2147502242> ?p4 ?o4 .\n" + > " <http://www.abc.org/2147502243> ?p5 ?o5 .\n" + > " <http://www.abc.org/2147502244> ?p6 ?o6 .\n" + > " <http://www.abc.org/2147502245> ?p7 ?o7 .\n" + > " <http://www.abc.org/2147502246> ?p8 ?o8 .\n" + > " <http://www.abc.org/2147502247> ?p9 ?o9 .\n" + > " <http://www.abc.org/2147502248> ?p10 ?o10 .\n" + > " <http://www.abc.org/2147502249> ?p11 ?o11 .\n" + > " <http://www.abc.org/2147502250> ?p12 ?o12 .\n" + > " }\n" + > " WHERE {\n" + > " <http://www.abc.org/2147502238> ?p0 ?o0 .\n" + > " <http://www.abc.org/2147502239> ?p1 ?o1 .\n" + > " <http://www.abc.org/2147502240> ?p2 ?o2 .\n" + > " <http://www.abc.org/2147502241> ?p3 ?o3 .\n" + > " <http://www.abc.org/2147502242> ?p4 ?o4 .\n" + > " <http://www.abc.org/2147502243> ?p5 ?o5 .\n" + > " <http://www.abc.org/2147502244> ?p6 ?o6 .\n" + > " <http://www.abc.org/2147502245> ?p7 ?o7 .\n" + > " <http://www.abc.org/2147502246> ?p8 ?o8 .\n" + > " <http://www.abc.org/2147502247> ?p9 ?o9 .\n" + > " <http://www.abc.org/2147502248> ?p10 ?o10 .\n" + > " <http://www.abc.org/2147502249> ?p11 ?o11 .\n" + > " <http://www.abc.org/2147502250> ?p12 ?o12 .\n" + > " }\n" > {code} > Investigation : > In org.apache.jena.sparql.modify package UpdateProcessorBase.java function > execute() > "Iter.sendToSink(request.iterator(), sink);" seems to be the cause. > With 50 Statements in JENA and above DELETE Query it takes ~ 112 seconds. > -- This message was sent by Atlassian Jira (v8.3.4#803005)