{"id":16305155,"url":"https://github.com/moznion/mysql-explain-parser","last_synced_at":"2025-04-10T23:55:18.116Z","repository":{"id":56836187,"uuid":"20966688","full_name":"moznion/MySQL-Explain-Parser","owner":"moznion","description":"Parser for result of EXPLAIN of MySQL","archived":false,"fork":false,"pushed_at":"2014-06-20T16:06:09.000Z","size":180,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-10T23:55:14.483Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/moznion.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-06-18T15:10:58.000Z","updated_at":"2018-04-25T09:43:54.000Z","dependencies_parsed_at":"2022-09-07T07:10:46.140Z","dependency_job_id":null,"html_url":"https://github.com/moznion/MySQL-Explain-Parser","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moznion%2FMySQL-Explain-Parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moznion%2FMySQL-Explain-Parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moznion%2FMySQL-Explain-Parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moznion%2FMySQL-Explain-Parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moznion","download_url":"https://codeload.github.com/moznion/MySQL-Explain-Parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248317701,"owners_count":21083528,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T21:05:52.907Z","updated_at":"2025-04-10T23:55:18.092Z","avatar_url":"https://github.com/moznion.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/moznion/MySQL-Explain-Parser.png?branch=master)](https://travis-ci.org/moznion/MySQL-Explain-Parser) [![Coverage Status](https://coveralls.io/repos/moznion/MySQL-Explain-Parser/badge.png?branch=master)](https://coveralls.io/r/moznion/MySQL-Explain-Parser?branch=master)\n# NAME\n\nMySQL::Explain::Parser - Parser for result of EXPLAIN of MySQL\n\n# SYNOPSIS\n\n    use utf8;\n    use MySQL::Explain::Parser qw/parse/;\n\n    my $explain = \u003c\u003c'...';\n    +----+-------------+-------+-------+---------------+---------+---------+------+------+----------+-------------+\n    | id | select_type | table | type  | possible_keys | key     | key_len | ref  | rows | filtered | Extra       |\n    +----+-------------+-------+-------+---------------+---------+---------+------+------+----------+-------------+\n    |  1 | PRIMARY     | t1    | index | NULL          | PRIMARY | 4       | NULL | 4    | 100.00   |             |\n    |  2 | SUBQUERY    | t2    | index | a             | a       | 5       | NULL | 3    | 100.00   | Using index |\n    +----+-------------+-------+-------+---------------+---------+---------+------+------+----------+-------------+\n    ...\n\n    my $parsed = parse($explain);\n    # =\u003e\n    #    [\n    #        {\n    #            'id'            =\u003e '1',\n    #            'select_type'   =\u003e 'PRIMARY',\n    #            'table'         =\u003e 't1',\n    #            'type'          =\u003e 'index',\n    #            'possible_keys' =\u003e undef,\n    #            'key'           =\u003e 'PRIMARY',\n    #            'key_len'       =\u003e '4',\n    #            'ref'           =\u003e undef\n    #            'rows'          =\u003e '4',\n    #            'filtered'      =\u003e '100.00',\n    #            'Extra'         =\u003e '',\n    #        },\n    #        {\n    #            'id'            =\u003e '2',\n    #            'select_type'   =\u003e 'SUBQUERY',\n    #            'table'         =\u003e 't2',\n    #            'type'          =\u003e 'index',\n    #            'possible_keys' =\u003e 'a',\n    #            'key'           =\u003e 'a',\n    #            'key_len'       =\u003e '5',\n    #            'ref'           =\u003e undef\n    #            'rows'          =\u003e '3',\n    #            'filtered'      =\u003e '100.00',\n    #            'Extra'         =\u003e 'Using index',\n    #        }\n    #    ]\n\n# DESCRIPTION\n\nMySQL::Explain::Parser is the parser for result of EXPLAIN of MySQL.\n\nThis module provides `parse()` and `parse_vertical()` function.\nThese function receive the result of EXPLAIN or EXPLAIN EXTENDED, and return the parsed result as array reference that contains hash reference.\n\nThis module treat SQL's `NULL` as Perl's `undef`.\n\nPlease refer to the following pages to get information about format of EXPLAIN;\n\n- [http://dev.mysql.com/doc/en/explain-output.html](http://dev.mysql.com/doc/en/explain-output.html)\n- [http://dev.mysql.com/doc/en/explain-extended.html](http://dev.mysql.com/doc/en/explain-extended.html)\n\n# FUNCTIONS\n\n- `parse($explain : Str)`\n\n    Returns the parsed result of EXPLAIN as ArrayRef\\[HashRef\\]. This function can be exported.\n\n- `parse_vertical($explain : Str)`\n\n    Returns the parsed result of EXPLAIN which is formatted vertical as ArrayRef\\[HashRef\\]. This function can be exported.\n\n    e.g.\n\n        use utf8;\n        use MySQL::Explain::Parser qw/parse_vertical/;\n\n        my $explain = \u003c\u003c'...';\n        *************************** 1. row ***************************\n                   id: 1\n          select_type: PRIMARY\n                table: t1\n                 type: index\n        possible_keys: NULL\n                  key: PRIMARY\n              key_len: 4\n                  ref: NULL\n                 rows: 4\n             filtered: 100.00\n                Extra:\n        *************************** 2. row ***************************\n                   id: 2\n          select_type: SUBQUERY\n                table: t2\n                 type: index\n        possible_keys: a\n                  key: a\n              key_len: 5\n                  ref: NULL\n                 rows: 3\n             filtered: 100.00\n                Extra: Using index\n        ...\n\n        my $parsed = parse_vertical($explain);\n\n# LICENSE\n\nCopyright (C) moznion.\n\nThis library is free software; you can redistribute it and/or modify\nit under the same terms as Perl itself.\n\n# AUTHOR\n\nmoznion \u003cmoznion@gmail.com\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoznion%2Fmysql-explain-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoznion%2Fmysql-explain-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoznion%2Fmysql-explain-parser/lists"}