The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Pg::Explain::Hinter::Hint - Single hint for Pg::Explain plan

VERSION

Version 2.2

SYNOPSIS

These should be returned by Pg::Explain::Hinter, using:

    my $hinter = Pg::Explain::Hinter->new( $plan );
    if ( $hinter->any_hints ) {
        for my $hint ( @{ $hinter->hints } ) {
            ...
            printf "Hint for node #%d (%s) : %s\n", $hint->node->id, $hint->node_type, $hint->type;
            if ( $hint->details ) {
                print Dumper($hint->details);
            }
        }
    }

Read "HINT TYPES" part for more description of what hint types there can be, and what is the meaning of details for them.

FUNCTIONS

new

Object constructor.

type

Accessor for type inside hint.

node

Accessor for node inside hint.

details

Accessor for details inside hint.

HINT TYPES

There are various types of hints, and each have their own meaning of ->details:

DISK_SORT

Node that the hint is for is using sorting that is spilling to disk. It's possible that increasing work_mem would help.

Details:

  • Used disk space in kB

INDEXABLE_SEQSCAN_SIMPLE

Node that the hint is for is using sequential scan, but it should be possible to add simple index (on one column) that will make it faster.

Details:

  • Column name that the index should be made on

INDEXABLE_SEQSCAN_MULTI_EQUAL_AND

Node that the hint is for us using sequential scan, and it should be possible to add index(es) to make it go faster.

This happens only for scans that have multiple equality checks joined with AND operator, like:

  • a = 1 and b = 2

  • x = 'abc' and z = 12

Details are arrayref where each element is hashref with two keys:

  • column : column name that was checked

  • value : the value that the check was using

AUTHOR

hubert depesz lubaczewski, <depesz at depesz.com>

BUGS

Please report any bugs or feature requests to depesz at depesz.com.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Pg::Explain::Node

COPYRIGHT & LICENSE

Copyright 2008-2021 hubert depesz lubaczewski, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.