Code Monkey home page Code Monkey logo

Comments (5)

jrgemignani avatar jrgemignani commented on June 3, 2024 1

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.

pdpotter avatar pdpotter commented on June 3, 2024

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.

kysmou avatar kysmou commented on June 3, 2024

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.

jrgemignani avatar jrgemignani commented on June 3, 2024

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.

kysmou avatar kysmou commented on June 3, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.