From users-return-19539-archive-asf-public=cust-asf.ponee.io@jena.apache.org Thu Mar 7 20:09:45 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 03DD818067C for ; Thu, 7 Mar 2019 21:09:44 +0100 (CET) Received: (qmail 19074 invoked by uid 500); 7 Mar 2019 20:09:39 -0000 Mailing-List: contact users-help@jena.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jena.apache.org Delivered-To: mailing list users@jena.apache.org Received: (qmail 19062 invoked by uid 99); 7 Mar 2019 20:09:38 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Mar 2019 20:09:38 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id DAA6DC7CB0 for ; Thu, 7 Mar 2019 20:09:37 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.501 X-Spam-Level: X-Spam-Status: No, score=0.501 tagged_above=-999 required=6.31 tests=[HEADER_FROM_DIFFERENT_DOMAINS=0.001, KAM_EU=0.5, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 8UDKcH5ifpMj for ; Thu, 7 Mar 2019 20:09:36 +0000 (UTC) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id A9B9E5F4A9 for ; Thu, 7 Mar 2019 20:09:35 +0000 (UTC) Received: by mail-wr1-f65.google.com with SMTP id t18so18959942wrx.2 for ; Thu, 07 Mar 2019 12:09:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=rCp2CY/VokbgzWGmxmjpBu+fCrcSWCc5hNy7yZnKxQ0=; b=pZvABHk5lxxVJ4LYXpe/t25wu/4xZng8P1+U0Wa80h0lmf74gfdknEJ3j9CbjuakfP A88NYXAo+3E/ddIGfMScNxkUuScHA26PNp5vq4RI+A31oA/VLyRV3fMpck/naFD60JRA hYGLXjjVYU2o9T5oqjGcnBhWriLrEO9SHOA2LWutntuHhRWQlGMxIirRPqgYVYJ/JnEe Ei94yZlRyds/yoBeDIC42S63/A+At6GLzatJwB2HkaGgEwQe2ze/9tOPEqrr8KB1V3+3 enlk0S2f4q9DZPMK5p6VxV8C011EfWzuThQ/I3tx792wCmX2xuWSPOiOqG3xSVn+jwbH 0hkw== X-Gm-Message-State: APjAAAWGB4wfmFtiFwVDDLhtMA4Dy8dDkZ+83ZqinhRDgpXVFUEDKAE6 vIHVGFhS6o6hyZluQRbh/up5DVZNS6k= X-Google-Smtp-Source: APXvYqw+Sp+04QcwMZvYeYHQFAWCbanPc6/QgGpwleq6qqa3g+ylUuK35nyp/FIX7V1J19NCDDMifQ== X-Received: by 2002:adf:f805:: with SMTP id s5mr8170570wrp.234.1551989374889; Thu, 07 Mar 2019 12:09:34 -0800 (PST) Received: from [192.168.1.13] (cpc85428-aztw29-2-0-cust363.18-1.cable.virginm.net. [82.38.145.108]) by smtp.googlemail.com with ESMTPSA id v2sm9577796wme.29.2019.03.07.12.09.33 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Mar 2019 12:09:33 -0800 (PST) Subject: Re: Equivalent query and performances To: users@jena.apache.org References: From: Andy Seaborne Message-ID: <171aaa18-f383-839b-2d45-f94278e109a1@apache.org> Date: Thu, 7 Mar 2019 20:09:33 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit It might be going to the network though as far as I can tell, http://givingsense.eu/datamusee/onto/contextgraph18022019 does not have any triples. In order to do FROM, the query engine has to create create a different dataset and that can imped some TDB features. Have you tried: where { ?s a ?s a ?t; } also - what happens if you remove the "?s a ?t" because with the DISTINCT, it does not change the results. Andy On 07/03/2019 17:47, Zachary Whitley wrote: > I believe that the first query with the "from" will make a network call and > add what is returned to to default graph while the second one will query > the data already loaded in the named graph. If I'm correct that would > explain the difference and wouldn't be surprised to see the results you're > getting. > > https://jena.apache.org/tutorials/sparql_datasets.html > > On Thu, Mar 7, 2019 at 11:56 AM Jean-Claude Moissinac > wrote: > >> Hello >> >> I'm using jena-fuseki 3.6.0 >> I've tried two queries which, for me seems equivalent: >> select (count(distinct ?s) as ?c) >> from >> where { >> ?s a ?t; >> a >> } >> and >> select (count(distinct ?s) as ?c) >> where { >> graph { >> ?s a ?t; >> a >> } >> } >> >> The second is much muck quickest than the first; for example, 42712 ms for >> the first one and 524 ms for the second >> It's a penalty because I would like sometimes to use several graphs and the >> from version seems to be the good way. >> >> Any advices or comments? >> -- >> Jean-Claude Moissinac >> >