planner or statistical bug on 8.5 - Mailing list pgsql-hackers

From Pavel Stehule
Subject planner or statistical bug on 8.5
Date
Msg-id 162867791001112355o55b61b85t42bdf8b9271eb981@mail.gmail.com
Whole thread Raw
Responses Re: planner or statistical bug on 8.5  ("Dann Corbit" <DCorbit@connx.com>)
Re: planner or statistical bug on 8.5  (Matteo Beccati <php@beccati.com>)
List pgsql-hackers
Hello

I checked query and I was surprised with very strange plan:

postgres=# create table a(a int primary key);
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index
"a_pkey" for table "a"
CREATE TABLE
postgres=# create table b(b int primary key);
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index
"b_pkey" for table "b"
CREATE TABLE
postgres=# create table c(c int primary key);
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index
"c_pkey" for table "c"
CREATE TABLE
postgres=# ANALYZE ;
ANALYZE
postgres=# explain select  a, b from a,b,c;                             QUERY PLAN
-----------------------------------------------------------------------Nested Loop  (cost=0.00..276595350.00
rows=13824000000width=8)  ->  Nested Loop  (cost=0.00..115292.00 rows=5760000 width=8)        ->  Seq Scan on a
(cost=0.00..34.00rows=2400 width=4)        ->  Materialize  (cost=0.00..82.00 rows=2400 width=4)              ->  Seq
Scanon b  (cost=0.00..34.00 rows=2400 width=4)  ->  Materialize  (cost=0.00..82.00 rows=2400 width=0)        ->  Seq
Scanon c  (cost=0.00..34.00 rows=2400 width=0)
 
(7 rows)

Regards
Pavel Stehule


pgsql-hackers by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: Compression Library and Usages
Next
From: "Dann Corbit"
Date:
Subject: Re: planner or statistical bug on 8.5