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

Delete Edge from empty subquery with bad performance #5874

Closed
oliverfleetwood opened this issue Mar 23, 2016 · 3 comments
Closed

Delete Edge from empty subquery with bad performance #5874

oliverfleetwood opened this issue Mar 23, 2016 · 3 comments
Assignees
Milestone

Comments

@oliverfleetwood
Copy link

According to the documentation, edges from a subquery should be done as:

DELETE EDGE E WHERE @rid IN (SELECT FROM #11:0)

Now, if record 11:0 has been deleted or if the subquery returns empty results, orientdb will scan the entire edge class and you'll get a warning that the query returned a lot of records, which of course is bad for performance. Obviously, if the subquery is empty the command should just terminate. I'm using orientdb 2.1.13.


For DELETE Vertex this is not the case.

DELETE VERTEX FROM (Select from DELETED_RECORD)

works like a charm.


FYI, what we're trying to do here is to lock the record during delete which is actually a part of #3595 .

DELETE VERTEX FROM (Select from SOME_VERTEX LOCK RECORD)
DELETE EDGE E WHERE @rid IN (SELECT FROM SOME_EDGE LOCK RECORD)
@luigidellaquila
Copy link
Member

Hi @oliverfleetwood

I think it's worth implementing the following syntax:

DELETE EDGE #rid

I marked it as an enhancement, I'll work on it asap

Thanks

Luigi

@lvca lvca added this to the 3.0 milestone Aug 4, 2017
@lvca
Copy link
Member

lvca commented Aug 31, 2017

@luigidellaquila is this already supported by 3.0?

@luigidellaquila
Copy link
Member

Hi @lvca

I have to check it, but in case we can implement it

Thanks

Luigi

@lvca lvca modified the milestones: 3.0.0, 3.0.x Apr 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants