Re: [HACKERS] Almost there on column aliases

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>
Cc: Postgres Hackers List <hackers(at)postgreSQL(dot)org>
Subject: Re: [HACKERS] Almost there on column aliases
Date: 2000-02-11 06:41:07
Message-ID: 18707.950251267@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu> writes:
> Could someone run a "-d 99" query using the following from the
> regression test (rules.sql):
> select rtest_t2.a, rtest_t3.b
> from rtest_t2, rtest_t3
> where rtest_t2.a = rtest_t3.a;
> and send me the query, the rewritten query, and the plan emitted by
> the backend (it should be a MERGEJOIN plan)? It might speed up my
> rummaging around for the reason for the failure :(

This doesn't look very detailed, is it really what you wanted?

StartTransactionCommand
query: explain
select rtest_t2.a, rtest_t3.b
from rtest_t2, rtest_t3
where rtest_t2.a = rtest_t3.a
parser outputs:

{ QUERY :command 5 :utility ? :resultRelation 0 :into <> :isPortal false :isBinary false :isTemp false :unionall false :distinctClause <> :sortClause <> :rtable <> :targetlist <> :qual <> :groupClause <> :havingQual <> :hasAggs false :hasSubLinks false :unionClause <> :intersectClause <> :limitOffset <> :limitCount <> :rowMark <>}

after rewriting:
{ QUERY
:command 5
:utility ?
:resultRelation 0
:into <>
:isPortal false
:isBinary false
:isTemp false
:unionall false
:distinctClause <>
:sortClause <>
:rtable <>
:targetlist <>
:qual <>
:groupClause <>
:havingQual <>
:hasAggs false
:hasSubLinks false
:unionClause <>
:intersectClause <>
:limitOffset <>
:limitCount <>
:rowMark <>
}

ProcessUtility: explain
select rtest_t2.a, rtest_t3.b
from rtest_t2, rtest_t3
where rtest_t2.a = rtest_t3.a
NOTICE: QUERY PLAN:

Merge Join (cost=164.66 rows=10000 width=12)
-> Sort (cost=69.83 rows=1000 width=8)
-> Seq Scan on rtest_t3 (cost=20.00 rows=1000 width=8)
-> Sort (cost=69.83 rows=1000 width=4)
-> Seq Scan on rtest_t2 (cost=20.00 rows=1000 width=4)

CommitTransactionCommand

> Another possibility is that I submit/commit my patches (there are
> quite a few files touched and I *really* want to get them off of my
> system and into the tree soon) but I was a bit hesitant to commit
> something with a known problem of this nature.

Any changes in backend/optimizer/ ? I've got a bunch of uncommitted
changes there myself.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Meskes 2000-02-11 06:41:10 Re: [HACKERS] psql and libpq fixes
Previous Message Michael Meskes 2000-02-11 06:39:43 Re: [HACKERS] psql and libpq fixes