Hello Dimitris,

I'd rephrase the query, magin the filter index-friendly:

SELECT ?wiki, ?dbp, bif:datediff('second',  xsd:DateTime(?extracted),
now()) AS ?secondsAgo
 FROM <http://nl.dbpedia.org>
 WHERE {
 ?wiki foaf:primaryTopic ?dbp .
 ?dbp  dcterms:modified ?extracted .
 FILTER ( ?extracted > bif:dateadd('minute', -10, now()))
} order by desc (?extracted) 
 LIMIT 30

In this case the presence or the absence of the order by does not matter
too much, because the query is way more straightforward: selective
index-friendly filter first, and the selection could be ordered
naturally via hot index used by the filter.

Note also that if you know the datatype of an object literal, there's no
need to write a cast like xsd:dateTime --- it can make an expression
index-unfriendly even if it will always return the argument unchanged on
your specific data.

Best Regards,

Ivan Mikhailov
OpenLink Software
http://virtuoso.openlinksw.com

On Mon, 2013-08-12 at 18:48 +0300, Dimitris Kontokostas wrote:
> Hi, I am experimenting with a new "latest updates" display for DBpedia
> Live in Dutch where I get the list live from Virtuoso with javascript
> http://live.nl.dbpedia.org/statistics/statistics.html
> 
> 
> I am storing the timestamp of all the extracted item as a
> dcterms:modified on the dbpedia resource and run the following query :
> 
> 
> SELECT ?wiki, ?dbp, bif:datediff('second',  xsd:DateTime(?extracted),
> now()) AS ?secondsAgo
>  FROM <http://nl.dbpedia.org>
>  WHERE {
>  ?wiki foaf:primaryTopic ?dbp .
>  ?dbp  dcterms:modified ?extracted .
>  FILTER ( bif:datediff('minute', now(),  xsd:DateTime(?extracted)) <=
> 10 )
> }  ORDER BY DESC(?extracted)
>  LIMIT 30
> 
> 
> The problem is that the query is too slow and sometimes does not
> return and the page looks empty
> 
> 
> Is there a way I can change the query to speed it up or should i try
> to get the update list outside virtuoso?
> 
> 
> An average update on the Dutch Live server is 2-3 articles per second
> but may also range from 0 to 10 at peaks, also note that we will port
> this method to the English Live where the update frequency is higher.
> 
> 
> Best,
> 
> Dimitris
> 
> -- 
> Dimitris Kontokostas
> Department of Computer Science, University of Leipzig
> Research Group: http://aksw.org
> Homepage:http://aksw.org/DimitrisKontokostas
> ------------------------------------------------------------------------------
> Get 100% visibility into Java/.NET code with AppDynamics Lite!
> It's a free troubleshooting tool designed for production.
> Get down to code-level detail for bottlenecks, with <2% overhead. 
> Download for free and get started troubleshooting in minutes. 
> http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
> _______________________________________________ Virtuoso-users mailing list 
> Virtuoso-users@lists.sourceforge.net 
> https://lists.sourceforge.net/lists/listinfo/virtuoso-users




------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users

Reply via email to