Re: Optimizer showing wrong rows in plan

От: Tom Lane
Тема: Re: Optimizer showing wrong rows in plan
Дата: ,
Msg-id: 22618.1269793661@sss.pgh.pa.us
(см: обсуждение, исходный текст)
Ответ на: Re: Optimizer showing wrong rows in plan  (Tadipathri Raghu)
Ответы: Re: Optimizer showing wrong rows in plan  (Jeremy Harris)
Список: pgsql-performance

Скрыть дерево обсуждения

Optimizer showing wrong rows in plan  (Tadipathri Raghu, )
 Re: Optimizer showing wrong rows in plan  (Szymon Guz, )
  Re: Optimizer showing wrong rows in plan  (Tadipathri Raghu, )
   Re: Optimizer showing wrong rows in plan  (Szymon Guz, )
    Re: Optimizer showing wrong rows in plan  (Tadipathri Raghu, )
     Re: Optimizer showing wrong rows in plan  (Tom Lane, )
      Re: Optimizer showing wrong rows in plan  (Jeremy Harris, )
       Re: Optimizer showing wrong rows in plan  (Tom Lane, )
        Re: Optimizer showing wrong rows in plan  (Tadipathri Raghu, )
         Re: Optimizer showing wrong rows in plan  (Matthew Wakeling, )
          Re: Optimizer showing wrong rows in plan  (raghavendra t, )
           Re: Optimizer showing wrong rows in plan  (Nikolas Everett, )
 Re: Optimizer showing wrong rows in plan  (Tadipathri Raghu, )
  Re: Optimizer showing wrong rows in plan  (Frank Heikens, )
  Re: Optimizer showing wrong rows in plan  (Gary Doades, )

Tadipathri Raghu <> writes:
> Frankly speaking its a newly created table without any operation on it as
> you have seen the example. Then how come it showing those many rows where we
> have only one in it.

Yes.  This is intentional: the size estimates for a never-yet-analyzed
table are *not* zero.  This is because people frequently create and load
up a table and then immediately query it without an explicit ANALYZE.
The quality of the plans you'd get at that point (especially for joins)
would be spectacularly bad if the default assumption were that the table
was very small.

            regards, tom lane


В списке pgsql-performance по дате сообщения:

От: Cédric Villemain
Дата:
Сообщение: Re: Forcing index scan on query produces 16x faster
От: Greg Smith
Дата:
Сообщение: Re: Database size growing over time and leads to performance impact