Re: explain analyze

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
Cc: Tourtounis Sotiris <tourtoun(at)csd(dot)uoc(dot)gr>, pgsql-general(at)postgresql(dot)org
Subject: Re: explain analyze
Date: 2002-09-14 14:56:45
Message-ID: 26685.1032015405@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com> writes:
> On Fri, 13 Sep 2002, Tourtounis Sotiris wrote:
>> select Y.at from table Y where Y.at >=1 and Y.at < 253214
>>
>> I have state an index on attribute at and by using the explain in front of
>> the select ... i get the information of an index scan-however i can't
>> distingusish whether that index scan refers to one of the two comparisons
>> or to the conjuction of those two - how i can see that?

This is one of the situations that I had in mind when I expanded
EXPLAIN's display for 7.3 ...

> 7.3's explain will show you the limiting clauses. In past versions
> I'm not sure but possibly explain verbose would show it to you but that's
> just about unreadable.

You can figure it out from the EXPLAIN VERBOSE output if you are
determined. I'd recommend looking at the pretty-printed form that
appears in the postmaster log, rather than the unformatted dump you get
in the NOTICE. Look at the "indxqual" for the indexscan node, and see
how many operator invocations it contains. If you want you can
correlate the operator OIDs to pg_operator to be sure of what you are
looking at. For instance this is what "where unique1>0 and
unique1<20" looks like:

:indxqual ((
{ EXPR
:typeOid 16
:opType op
:oper
{ OPER
:opno 521
:opid 147
:opresulttype 16
}

:args (
{ VAR
:varno 1
:varattno 1
:vartype 23
:vartypmod -1
:varlevelsup 0
:varnoold 1
:varoattno 1
}

{ CONST
:consttype 23
:constlen 4
:constbyval true
:constisnull false
:constvalue 4 [ 0 0 0 0 ]
}
)
}

{ EXPR
:typeOid 16
:opType op
:oper
{ OPER
:opno 97
:opid 66
:opresulttype 16
}

:args (
{ VAR
:varno 1
:varattno 1
:vartype 23
:vartypmod -1
:varlevelsup 0
:varnoold 1
:varoattno 1
}

{ CONST
:consttype 23
:constlen 4
:constbyval true
:constisnull false
:constvalue 4 [ 0 0 0 20 ]
}
)
}
)
)

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2002-09-14 15:12:06 Re: Size of database
Previous Message Michael und Katrin Rudolph 2002-09-14 11:32:05 Re: mod_auth_pgsql