Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

poor performance for order clause #5680

Closed
martingg88 opened this issue Feb 3, 2016 · 10 comments
Closed

poor performance for order clause #5680

martingg88 opened this issue Feb 3, 2016 · 10 comments
Assignees

Comments

@martingg88
Copy link

The following query take about 2 to 3 seconds from 80k records even though i already index out property. any idea?

SELECT in AS rid FROM list WHERE out = #16:5 ORDER BY (@Rid DESC) LIMIT 13

@wolf4ood
Copy link
Member

wolf4ood commented Feb 3, 2016

can you post the explain of this query?

EXPLAIN SELECT in AS rid FROM list WHERE out = #16:5 ORDER BY (@rid DESC) LIMIT 13

@martingg88
Copy link
Author

here is the explain:

{
    "result": [
        {
            "@type": "d",
            "@version": 0,
            "documentReads": 35205,
            "fullySortedByIndex": false,
            "documentAnalyzedCompatibleClass": 35205,
            "recordReads": 35205,
            "fetchingFromTargetElapsed": 440,
            "indexIsUsedInOrderBy": false,
            "compositeIndexUsed": 1,
            "current": "#68:35954",
            "involvedIndexes": [
                "list.out"
            ],
            "limit": 13,
            "orderByElapsed": 4,
            "evaluated": 35205,
            "elapsed": 450.49084,
            "resultType": "collection",
            "resultSize": 13,
            "@fieldTypes": "documentReads=l,documentAnalyzedCompatibleClass=l,recordReads=l,fetchingFromTargetElapsed=l,compositeIndexUsed=l,current=x,involvedIndexes=e,orderByElapsed=l,evaluated=l,elapsed=f"
        }
    ],
    "notification": "Query executed in 0.659 sec. Returned 1 record(s)"
}

@martingg88
Copy link
Author

any idea to improve performance for order by alias property like following query?

SELECT in AS rid , in.ctime as ctime FROM list WHERE out = #16:5 ORDER BY (ctime DESC) LIMIT 13

@martingg88
Copy link
Author

no update?

@wolf4ood
Copy link
Member

how much is the execution time?

@martingg88
Copy link
Author

more than 20 seconds for 30k records. feel very upset about this database already as we don't think it is capable for production.

@wolf4ood
Copy link
Member

@martingg88

can you post the explain of this

SELECT in AS rid , in.ctime as ctime FROM list WHERE out = #16:5 ORDER BY (ctime DESC) LIMIT 13

and the result of this?

select count (*) from list

Thanks

@martingg88
Copy link
Author

can you try it at your side with database has 30k records.

I'm sure you will have really suck performance for order by alias property.

@wolf4ood
Copy link
Member

hi @martingg88

we could speed up things if you can send me a test db where i can try your queries and help you optimize it.

My email is e.risa@orientdb.com

@martingg88
Copy link
Author

guys the issue is your side didn't optimize performance for query that have order clause with alias property. Please check with you team. I'm sorry that i can't send you the db as it is confidential data for my client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

5 participants