Oihana PHP Arango

ExplainResult

Read onlyYes

A typed view over the `POST /_api/explain` response returned by {@see \oihana\arango\clients\Database::explain()}.

The raw plan tree is deep and version-dependent, so it is kept available through self::raw() / self::plan(); the accessors here surface the parts you usually need when tuning a query: the optimizer rules that fired, the collections touched, the estimated cost, and — most importantly — the indexes the query actually uses (self::indexesUsed()).

Tags
since
1.1.0
author

Marc Alcaraz

Table of Contents

Properties

$data  : array<string|int, mixed>

Methods

__construct()  : mixed
collections()  : array<int, string>
The names of the collections accessed by the query.
estimatedCost()  : float
The optimizer's estimated total cost of the plan.
estimatedNrItems()  : int
The optimizer's estimated number of result items.
indexesUsed()  : array<int, IndexUse>
The indexes the query actually uses, gathered from every `IndexNode` of the plan.
isCacheable()  : bool
Whether the query result could be served from the query results cache.
isModificationQuery()  : bool
Whether the query writes data (INSERT / UPDATE / REPLACE / REMOVE / UPSERT).
nodeTypes()  : array<int, string>
The ordered list of execution node types (`SingletonNode`, `IndexNode`, …).
plan()  : array<string, mixed>
The raw execution plan (`nodes`, `rules`, `collections`, `estimatedCost`, …), or an empty array when the server returned none.
raw()  : array<string, mixed>
The raw, unmodified `/_api/explain` response body.
rules()  : array<int, string>
The names of the optimizer rules that were applied to the query.
usesIndex()  : bool
Whether the query uses at least one index (i.e. it is not a full collection scan).
warnings()  : array<int, mixed>
The optimizer warnings raised while planning the query.

Properties

Methods

__construct()

public __construct(array<string, mixed> $data) : mixed
Parameters
$data : array<string, mixed>

The raw /_api/explain response body.

collections()

The names of the collections accessed by the query.

public collections() : array<int, string>
Return values
array<int, string>

estimatedCost()

The optimizer's estimated total cost of the plan.

public estimatedCost() : float
Return values
float

estimatedNrItems()

The optimizer's estimated number of result items.

public estimatedNrItems() : int
Return values
int

indexesUsed()

The indexes the query actually uses, gathered from every `IndexNode` of the plan.

public indexesUsed() : array<int, IndexUse>
Return values
array<int, IndexUse>

isCacheable()

Whether the query result could be served from the query results cache.

public isCacheable() : bool
Return values
bool

isModificationQuery()

Whether the query writes data (INSERT / UPDATE / REPLACE / REMOVE / UPSERT).

public isModificationQuery() : bool
Return values
bool

nodeTypes()

The ordered list of execution node types (`SingletonNode`, `IndexNode`, …).

public nodeTypes() : array<int, string>
Return values
array<int, string>

plan()

The raw execution plan (`nodes`, `rules`, `collections`, `estimatedCost`, …), or an empty array when the server returned none.

public plan() : array<string, mixed>
Return values
array<string, mixed>

raw()

The raw, unmodified `/_api/explain` response body.

public raw() : array<string, mixed>
Return values
array<string, mixed>

rules()

The names of the optimizer rules that were applied to the query.

public rules() : array<int, string>
Return values
array<int, string>

usesIndex()

Whether the query uses at least one index (i.e. it is not a full collection scan).

public usesIndex() : bool
Return values
bool

warnings()

The optimizer warnings raised while planning the query.

public warnings() : array<int, mixed>
Return values
array<int, mixed>
On this page

Search results