Re: 500x speed-down: Wrong query plan?

От: Tom Lane
Тема: Re: 500x speed-down: Wrong query plan?
Дата: ,
Msg-id: 6719.1136832065@sss.pgh.pa.us
(см: обсуждение, исходный текст)
Ответ на: Re: 500x speed-down: Wrong query plan?  (Alessandro Baretta)
Ответы: Re: 500x speed-down: Wrong query plan?  (Alessandro Baretta)
Список: pgsql-performance

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

500x speed-down: Wrong query plan?  (Alessandro Baretta, )
 Re: 500x speed-down: Wrong query plan?  (Matteo Beccati, )
  Re: 500x speed-down: Wrong query plan?  (Alessandro Baretta, )
   Re: 500x speed-down: Wrong query plan?  (Tom Lane, )
    Re: 500x speed-down: Wrong query plan?  (Alessandro Baretta, )
     Re: 500x speed-down: Wrong query plan?  (Tom Lane, )
      Re: 500x speed-down: Wrong statistics!  (Alessandro Baretta, )
       Re: 500x speed-down: Wrong statistics!  (Tom Lane, )
        Re: 500x speed-down: Wrong statistics!  (Alessandro Baretta, )
 Re: 500x speed-down: Wrong query plan?  (Jaime Casanova, )

Alessandro Baretta <> writes:
> Matteo Beccati wrote:
>> Are you sure that you recentrly ANALYZED the table "ubicazione"? If so,
>> try to increase statistics for the id_ente column.

> No, this is not the problem. I increased the amount of statistics with ALTER
> TABLE ... SET STATISTICS 1000, which is as much as I can have.

What Matteo wanted to know is if you'd done an ANALYZE afterward.  ALTER
TABLE SET STATISTICS doesn't in itself update the statistics.

What do you get from

EXPLAIN SELECT * FROM articolo WHERE articolo.xdbs_modified > '2006-01-08 18:25:00+01';

I'm curious to see how many rows the planner thinks this will produce,
and whether it will use the index or not.

Also, I gather from the plan choices that the condition id_ente = 'dmd'
isn't very selective ... what fraction of the rows in each table
satisfy that?

            regards, tom lane


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

От: Bruce Momjian
Дата:
Сообщение: Re: [PERFORMANCE] Beetwen text and varchar field
От: Andrea Arcangeli
Дата:
Сообщение: NOT LIKE much faster than LIKE?