Help needed to optimize query

0 views
Skip to first unread message

yrpa...@gmail.com

unread,
Jul 8, 2016, 5:12:36 AM7/8/16
to Stardog
Hello,

I am new to SPARQL queries. I have created query to be used for autosuggestion in our project. I am searching the user input term in our database (with 500K triples). As it is going to be used for autosuggest it needs to be super fast. 

Here is my query : 

select DISTINCT ?label where
{
   
?s smt:lcLabel ?label.
     FILTER
(STRSTARTS(?label,"ben"))
   
}
order
by (STRLEN(?label))
limit
10

"ben" is user input in this query. We are sorting result due to business requirement to display shortest word first.

Currently this query is taking 0.8 milli seconds which is slow for us. 

So can someone help me reduce the execution time for this query?

Thank you in advance.

Best Regards,
Yogesh Patil

Zachary Whitley

unread,
Jul 8, 2016, 6:23:31 AM7/8/16
to sta...@clarkparsia.com
Try using the full-text search. It should be faster 

--
-- --
You received this message because you are subscribed to the C&P "Stardog" group.
To post to this group, send email to sta...@clarkparsia.com
To unsubscribe from this group, send email to
stardog+u...@clarkparsia.com
For more options, visit this group at
http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en
---
You received this message because you are subscribed to the Google Groups "Stardog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stardog+u...@clarkparsia.com.

Andrew Glassman

unread,
Jul 8, 2016, 9:15:11 AM7/8/16
to sta...@clarkparsia.com
Yogesh, 

Just to clarify, is the query taking 0.8 seconds, or 8 milliseconds?  0.8 milliseconds seems fast to me.

-Andy Glassman

yrpa...@gmail.com

unread,
Jul 13, 2016, 7:21:54 AM7/13/16
to Stardog
I tried full-text search and its really very fast, however it is not serving our usecase of starts with. So now we have decided to use Named Graph feature and it is also very fast.

Thanks for help :)
Reply all
Reply to author
Forward
0 new messages