Re: Delete/update with limit
От | Stephan Szabo |
---|---|
Тема | Re: Delete/update with limit |
Дата | |
Msg-id | 20070724082230.X42241@megazone.bigpanda.com обсуждение исходный текст |
Ответ на | Re: Delete/update with limit (Csaba Nagy <nagy@ecircle-ag.com>) |
Ответы |
Re: Delete/update with limit
Re: Delete/update with limit |
Список | pgsql-general |
On Tue, 24 Jul 2007, Csaba Nagy wrote: > > How about using the following? > > > > delete from <table> > > where ctid in (select ctid from <table> limit <num>); > > > > I actually checked this out before starting this thread, and the plan > looked like: > > > explain delete from my_table where ctid in (select ctid from my_table > limit 10); Unfortunately the stuff that makes a ctid=<value> nice doesn't seem to be used when you're doing an in. It's possible that a function that does something like for rec in select ctid from my_table limit 10 loop delete from my_table where ctid=rec.ctid; end loop might do okay, but I haven't tried it.
В списке pgsql-general по дате отправления: