making multiple updates use indexes: howto?

Поиск
Список
Период
Сортировка
От Pedro Alves
Тема making multiple updates use indexes: howto?
Дата
Msg-id 20030707165751.GA19656@cosmos.inesc.pt
обсуждение исходный текст
Ответы Re: making multiple updates use indexes: howto?  (Mike Mascari <mascarm@mascari.com>)
Список pgsql-general
    Hi.


    I have a doubt:

    If I make:

 update stockline set status=3 where id IN (select id from lap_mpdetail_view where lap=3976)

    postgres makes an Seq Scan on stockline.

    when stockline is big, it is better to make an select id from
lap_mpdetail_view where lap=3976) and programaticaly build the query of the
type update stockline set status=3 where id=X or id=Y or...


    There must be a better way... EXISTS also make a seq scan

    update stockline set status=3 where id = (select id from
lap_mpdetail_view where lap=3976); returns more than one tuple



    Thanks



--
Pedro Miguel G. Alves            pmalves@think.pt
THINK - Tecnologias de Informação    www.think.pt
Tel:   +351 21 413 46 00  Av. José Gomes Ferreira
Fax:   +351 21 413 46 09     nº 13 1495-139 ALGÉS

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

Предыдущее
От: "Clay Luther"
Дата:
Сообщение: Re: Using C++ With SPI?
Следующее
От: Dmitry Tkach
Дата:
Сообщение: Backwards index scan