Re: 7.4 - FK constraint performance
От | Tom Lane |
---|---|
Тема | Re: 7.4 - FK constraint performance |
Дата | |
Msg-id | 2662.1076687804@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: 7.4 - FK constraint performance (Stephan Szabo <sszabo@megazone.bigpanda.com>) |
Ответы |
Re: 7.4 - FK constraint performance
|
Список | pgsql-sql |
Stephan Szabo <sszabo@megazone.bigpanda.com> writes: > On Fri, 13 Feb 2004, Tom Lane wrote: >> I was looking at that last night. It seems like we could add a LIMIT at >> least in some contexts. In the case at hand, we're just going to error >> out immediately if we find a matching row, and so there's no need for >> FOR UPDATE, is there? > I think there still is, because a not yet committed transaction could have > deleted them all in which case I think the correct behavior is to wait and > if that transaction commits allow the action and if it rolls back to > error. Good point. Okay, we can't put in a LIMIT. But we could still hack the planner to prefer a fast-start plan by passing an out-of-band tuple fraction, for those RI plans where it's appropriate. That would not affect correctness. >> However, I'm not sure it would help the OP anyway. With the stats he >> had, the planner would still take a seqscan, because it's going to >> expect that it can find a match by probing the first ten or so rows of >> the first page. With anything close to the normal cost parameters, >> that's going to look more expensive than an index probe. s/more expensive/less expensive/ ... need more caffeine obviously ... regards, tom lane
В списке pgsql-sql по дате отправления: