Re: Performance Issue (Not using Index when joining two tables).

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Performance Issue (Not using Index when joining two tables).
Дата
Msg-id 850901.1600016827@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Performance Issue (Not using Index when joining two tables).  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Ответы Re: Performance Issue (Not using Index when joining two tables).  (Michael Lewis <mlewis@entrata.com>)
Список pgsql-performance
Tomas Vondra <tomas.vondra@2ndquadrant.com> writes:
> Most of the time (3460ms) is spent in the sequential scan on
> chr_simple_val, and the seqscan on chr_emp_position is taking ~330ms).
> Combined that's 3790ms out of 3797ms, so the join is pretty much
> irrelevant.

> Either the seqscans are causing a lot of I/O, or maybe the f_sel_*
> functions in the filter are expensive. Judging by how few rows are in
> the tables (not sure how large the tables are), I'd guess it's the
> latter ... Hard to say without knowing what the functions do etc.

I think the OP is wishing that the filter functions for the larger table
would be postponed till after the join condition is applied.  I'm a
little dubious that that's going to save anything meaningful; but maybe
increasing the cost attributed to those functions would persuade the
planner to try it that way.

First though, does forcing a nestloop plan (turn off enable_hashjoin,
and enable_mergejoin too if needed) produce the shape of plan you
want?  And if so, is it actually faster?  Only if those things are
true is it going to be worth messing with costing parameters.

            regards, tom lane



В списке pgsql-performance по дате отправления:

Предыдущее
От: Tomas Vondra
Дата:
Сообщение: Re: Performance Issue (Not using Index when joining two tables).
Следующее
От: Michael Lewis
Дата:
Сообщение: Re: Performance Issue (Not using Index when joining two tables).