Comments (5)
EXPLAIN has been added to the master repository. It is available by pulling the latest source down - not the latest release.
In order to use it, you will need to put the EXPLAIN inside of the cypher function. For example -
psql-11.5-5432-pgsql=# SELECT * FROM cypher('G', $$EXPLAIN MATCH (u)-[]->() RETURN u $$) AS (u agtype);
QUERY PLAN
--------------------------------------------------------------------------------------------------------------
Gather (cost=1000.00..245939.57 rows=69877 width=32)
Workers Planned: 2
-> Nested Loop (cost=0.00..237951.87 rows=29115 width=32)
Join Filter: (graphid_to_agtype(_age_default_alias_0_1.start_id) = graphid_to_agtype(u.id))
-> Parallel Append (cost=0.00..70.91 rows=1617 width=8)
-> Parallel Seq Scan on edge1 _age_default_alias_0_1 (cost=0.00..15.71 rows=571 width=8)
-> Parallel Seq Scan on edge2 _age_default_alias_0_2 (cost=0.00..15.71 rows=571 width=8)
-> Parallel Seq Scan on edge3 _age_default_alias_0_3 (cost=0.00..15.71 rows=571 width=8)
-> Parallel Seq Scan on edge4 _age_default_alias_0_4 (cost=0.00..15.71 rows=571 width=8)
-> Parallel Seq Scan on _ag_label_edge _age_default_alias_0 (cost=0.00..0.00 rows=1 width=8)
-> Append (cost=0.00..84.00 rows=3601 width=40)
-> Seq Scan on _ag_label_vertex u (cost=0.00..0.00 rows=1 width=40)
-> Seq Scan on begin u_1 (cost=0.00..22.00 rows=1200 width=40)
-> Seq Scan on middle u_2 (cost=0.00..22.00 rows=1200 width=40)
-> Seq Scan on "end" u_3 (cost=0.00..22.00 rows=1200 width=40)
(15 rows)
psql-11.5-5432-pgsql=#
from age.
The auto_explain module can be used to get details about nested statements.
LOAD 'auto_explain';
SET auto_explain.log_min_duration = 0;
SET auto_explain.log_analyze = true;
SET auto_explain.log_nested_statements = true;
In my case, the info was written to the log file /var/log/postgresql/postgresql-11-main.log
.
from age.
Thanks for your guide.
I think the guide you gave is a guide using the parameters of the extension.
I was wondering if the existing explain and explain analyze functions of postgresql, which can only check the queries required by the user, do not apply to the current age cypher.
from age.
I am currently attempting to add EXPLAIN, in its simple forms, to the openCypher grammar in AGE. But, at this point, I can't guarantee that it will be successful or useful.
John
from age.
I pulled the latest source down from age-github.
Tested as instructed by you and confirmed that the explain execution plan was shown.
SELECT * FROM cypher('test_graph', $$EXPLAIN MATCH p=(a)-[v]->(b)
RETURN p
$$) as (p agtype);
QUERY PLAN
Gather (cost=1000.00..143753.34 rows=35015 width=32)
Workers Planned: 2
-> Nested Loop (cost=0.00..139251.84 rows=14590 width=32)
Join Filter: (graphid_to_agtype(v_1.end_id) = graphid_to_agtype(b.id))
-> Nested Loop (cost=0.00..19871.84 rows=2430 width=96)
Join Filter: (graphid_to_agtype(v_1.start_id) = graphid_to_agtype(a.id))
-> Parallel Append (cost=0.00..17.73 rows=405 width=56)
-> Parallel Seq Scan on "RELTYPE" v_1 (cost=0.00..15.71 rows=571 width=56)
-> Parallel Seq Scan on _ag_label_edge v (cost=0.00..0.00 rows=1 width=56)
-> Append (cost=0.00..28.00 rows=1201 width=40)
-> Seq Scan on _ag_label_vertex a (cost=0.00..0.00 rows=1 width=40)
-> Seq Scan on "Person" a_1 (cost=0.00..22.00 rows=1200 width=40)
-> Append (cost=0.00..28.00 rows=1201 width=40)
-> Seq Scan on _ag_label_vertex b (cost=0.00..0.00 rows=1 width=40)
-> Seq Scan on "Person" b_1 (cost=0.00..22.00 rows=1200 width=40)
(15 rows)
Thank you.
from age.
Related Issues (20)
- How to assign cypher result to pgsql variable? HOT 2
- Is data duplicated in parent and label/edge tables? What are the internals? HOT 2
- Age graph existance check function, something like "graph_exists" would be very nice HOT 7
- Could you please help with example, how to correctly use age_graph_stats function HOT 3
- Convert vertex:: or edge:: into text or jsonb types HOT 3
- Asking community for input regarding setup GraphQL API server to integrate with Apache Age Graph Database ecosystem, more questions on same inside HOT 1
- How to allow special characters in labels, backticks only works for property names. HOT 1
- Server crashes when executing SELECT * FROM cypher('ag_graph_3'...) HOT 3
- Problem with the WITH clause: Vertex assigned to variable <x> was deleted. HOT 2
- List comprehension in WHERE clause results in server process segmentation fault HOT 3
- Server crashes when executing SELECT agtype_build_map('null'::agtype, 1); HOT 3
- Server crashes when executing PREPARE property_ps(agtype)...
- MATCH Query Syntax issues HOT 3
- Simple query takes long time to run HOT 12
- In Greenplum, compiling the AGE plugin fails with the error: 'void value not ignored as it ought to be HOT 2
- load_labels_from_file produced duplicated graphId HOT 3
- cypher returned agtype cannot work with postgres IN clause HOT 1
- One more request for exist type function, this time for vertex and edge, previous was for graph. HOT 1
- is_valid_label fails to validate label type, while is_valid_label_name is calling into is_valid_label, should be the other way around HOT 11
- Failure creating vertex with name close to MAX_LABEL_NAME_LEN 65535 HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from age.