Re: making multiple updates use indexes: howto?

Поиск
Список
Период
Сортировка
От Jim C. Nasby
Тема Re: making multiple updates use indexes: howto?
Дата
Msg-id 20030709143258.GJ69704@nasby.net
обсуждение исходный текст
Ответ на Re: making multiple updates use indexes: howto?  (Mike Mascari <mascarm@mascari.com>)
Список pgsql-general
On Mon, Jul 07, 2003 at 05:58:00PM -0400, Mike Mascari wrote:
> 2. I've found the following syntax to perform better, although I'm not
> sure of its portability:
>
> UPDATE stockline SET status = 3
> WHERE stockline.id = lap_mpdetail_view.id AND
> lap_mpdetail_view.lap = 3976;

Very un-portable. PGSQL is the only database I know of that will
construct a FROM clause for you on it's own. You should at least add

FROM lap_mpdetail_view

to the update. Even that isn't highly portable, though at least some
databases support that syntax. (Sybase and MS SQL come to mind).

--
Jim C. Nasby, Database Consultant                  jim@nasby.net
Member: Triangle Fraternity, Sports Car Club of America
Give your computer some brain candy! www.distributed.net Team #1828

Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming, or what?"

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

Предыдущее
От: Bjørn T Johansen
Дата:
Сообщение: Re: Sorting on fieldtype Time?
Следующее
От: Michal Zaborowski
Дата:
Сообщение: Re: Native dataprovider on Windows