Optimizer bug in UPDATE with subselect

Поиск
Список
Период
Сортировка
От Ace
Тема Optimizer bug in UPDATE with subselect
Дата
Msg-id 000501c2c238$1340b4c0$a4428a09@ASZEPCZYNSKI
обсуждение исходный текст
Ответ на Bug #880: COMMENT ON DATABASE depends on current database  (pgsql-bugs@postgresql.org)
Ответы Re: Optimizer bug in UPDATE with subselect  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
I've upgraded my DB to 7.3.1 from 7.2. The following update causes the SEQ
SCAN instead of INDEX SCAN (in 7.2 there was no bug like that):

create table machines(
 i_sprzetx int,
mod char(10),
type char(30)
);

create table sprzetx(
  rowid int,
  ident char(50)
);

create index i_sprzetx on sprzetx(ident);

inserts....

vacuum analyze sprzetx;

update machines set i_sprzetx=(
    select g.rowid from sprzetx g
      where g.ident=( trim(f.type) || trim(f.mod) )
  );

When optimizer meets ANY expression int the query clause switches from INDEX
to SEQUENTIAL disregarding the expression is constant for row.

Helps ALTER COLUMN to machines, UPDATE to TRIM || TRIM but sure it's not
solution.



----------------------------------------------------------------------
Czego nie wykorzystujesz, procentuje! mBIZNES Konto i mBIZNES MAX.
Efektywne oprocentowanie 5.64% i 6.59%. > http://link.interia.pl/f16c0

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

Предыдущее
От: pgsql-bugs@postgresql.org
Дата:
Сообщение: Bug #880: COMMENT ON DATABASE depends on current database
Следующее
От: "Averk"
Дата:
Сообщение: stored procedure namespace bug (critical) + COALECSE notice