-
Notifications
You must be signed in to change notification settings - Fork 871
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
Huge performance degradation (order by, skip/limit) #4957
Comments
same thing happened under 2.1. seems 'order by' cannot work with 'skip/limit' |
Hi, |
The query should be: SELECT COUNT(*) FROM share WHERE (out = #16:11704 AND in = #56:1240 And you should have a composite index against share class and "out" + "in" properties. Do you? |
Probably a composite index would solve the problem of martingg88. However, the main problem remains: the execution time of "order by" and "skip/limit" requests increased (3x) between rc4 and 2.1 (see my first post). Do you see any change that could have caused this problem? I didn't test rc5, rc6 and 2.1.1, so I can't tell exactly when the problem appeared :/ |
@luigidellaquila, could it be the new parsing time? |
@lvca.. i don't think i can create composite index as out and in are automatically created by edge |
i feel strange following composite index doesn't work in right way. I thought any one of properties in where clause will work for composite index if they are specified in index. right? But it's not working for what i have expected. any idea?
a. explain select country, country_name from place working fine b. explain select country, country_name, lat, lng from place working fine c. explain select country, country_name from place not working as not index is involved. |
indexed property in order by clause for vertex doesn't work. I do index 'ctime' property in vertex but it won't using that index when doing sorting. any idea ? explain select expand(inV()) from list not working for index. explain select from user working for index |
@lvca I'll take a look at this, but I don't think it's the case, 3x is too much (we could also test it in 2.2 snapshot, there we have parsed statement cache, so after the first execution there is no parse) @martingg88 in your query, the indexed field (ctime) is on the vertex, but the query target is the edge ('list'), right now indexing is used only on the query target |
@luigidellaquila thanks. is it bug for composite index stated above? |
Hi @martingg88 no, it's not a bug. Indexes are defined on classes, so when the query target is a class, available indexes can be easily identified. |
@luigidellaquila. sorry for make you confused. composite index should refer to following scenario. However composite index doesn't work out for direct query target. i feel strange following composite index doesn't work in right way. I thought any one of properties in where clause will work for composite index if they are specified in index. right? But it's not working for what i have expected. any idea? place.country NOTUNIQUE ["country_name","country"] SBTREE working fine b. explain select country, country_name, lat, lng from place working fine c. explain select country, country_name from place not working as not index is involved. |
@martingg88 it's a limitation of current index implementation (actually it's very common in index implementations, also in RDBMS): partial match is allowed on composite indexes only in the "left" part of the index, eg. if you have an index defined on A, B, C, it will be used when the query is filtering on A or on A, B, but not on B or C or B, C |
any idea how to improve the performance for order clause that is created/aliased on the fly? order clause without index will have Huge performance degradation. |
there is a terrible bad performance when you have order clause without index. hope there could have a nice solution to solve this issue. |
Is the order by performance issue getting fixed in any of the upcoming version? |
any update on this? |
I updated my 2.1rc4 to the 2.1.2 version and I noticed a huge performance loss on my skip/limit requets.
My tests follow this steps:
The following query takes approx. 6s with 2.1rc4 and approx. 30s with 2.1.2).
The following query takes approx. 7s with 2.1rc4 and approx. 37s with 2.1.2).
The following query takes approx. 11s with 2.1rc4 and approx. 45s with 2.1.2). The performance loss is similar with a key index on property1: approx. 6s with 2.1rc4 and approx. 25s with 2.1.2.
Basically, each performance test I run with "order by" or "skip/limit" is 3 times slower in 2.1.2, with and without indexation.
The text was updated successfully, but these errors were encountered: