Sort Order is wrong with Link

33 views
Skip to first unread message

Hung Tran

unread,
Jan 27, 2016, 11:30:20 AM1/27/16
to OrientDB
Hi,

I am using OrientDB version 2.1.8.



Remarks, it works when I alias Statistics.NumActiveContacts as v1, but the query will take long on a table > 50k records. See more details at Query is extremely slow when ORDER BY an alias

Any idea will be appreciated!

My Best,
Hung Tran

alessand...@gmail.com

unread,
Jan 28, 2016, 3:24:29 AM1/28/16
to OrientDB
Hi,
try this query

select from (select @rid, Statistics.NumActiveContacts from ContactList where (Account = #20:0) and (EntityInfo.State = 0)) order by Statistics asc, @rid asc skip 0 limit 5

Kind regards,
Alessandro

Hung Tran

unread,
Jan 28, 2016, 3:55:51 AM1/28/16
to OrientDB
Hi Alessandro,

Thank for your response, it's working, understood the logic. 

However, as a result, the query is doing fully cluster scan (verified), so the query performance is just similar to using alias.

My Best,
Hung Tran
Reply all
Reply to author
Forward
0 new messages