bitnine-oss / agensgraph

AgensGraph, a transactional graph database based on PostgreSQL
http://www.agensgraph.org
Other
1.34k stars 148 forks source link

It takes a long time to process when I set properties for edges #319

Open wenxue202012 opened 6 years ago

wenxue202012 commented 6 years ago

@gtyun I have to trouble you again. It takes a long time to process when I set properties for edges, Can you tell me why?

Set properties: image

No properties: image

gtyun commented 6 years ago

It is hard to guess with query only. Show the plan please.

wenxue202012 commented 6 years ago

@gtyun The excution plan is as follows: image

gtyun commented 6 years ago

Can you show me the other query’s plan? for comparison.

wenxue202012 commented 6 years ago

But direct use of the merge (fromNode)-[r:HAS{'source':'2'} ->(target), if I start with source=1 and then source=2, It will generate two edges instead of updating. image

gtyun commented 6 years ago

MERGE never update any graph element. It insures that graph pattern always exists in graph. MERGE returns graph pattern if it already exists, and creates it if it does not exist.

And Agensgraph has a performance issue with graph update. We improved it so it may be resolved in next major release.

wenxue202012 commented 6 years ago

merge (fromNode)-[r:HAS} ->(target) set r.source='2'

So in the next version, I'm going to update it this way, is there no performance problem? By the way, when will the next major version be wired?

gtyun commented 6 years ago

The unnecessary scans are removed so performance get much better. And the next release will be after June.

wenxue202012 commented 6 years ago

Is postgresql 10.0 available for this release?

gtyun commented 6 years ago

Yes, it will.