| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
|---|---|
| To: | ow <oneway_111(at)yahoo(dot)com> |
| Cc: | pgsql-sql(at)postgresql(dot)org |
| Subject: | Re: 7.4 - FK constraint performance |
| Date: | 2004-02-13 00:00:25 |
| Message-ID: | 24947.1076630425@sss.pgh.pa.us |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers pgsql-sql |
ow <oneway_111(at)yahoo(dot)com> writes:
> --- Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> I think it must be using a seqscan for the foreign key check query.
> 2) prepare foo(my.dint) as
> SELECT 1 FROM ONLY "my"."large" x WHERE "small_id" = $1 FOR UPDATE OF x;
> explain analyze execute foo(201);
> QUERY PLAN
> Seq Scan on large x (cost=0.00..1787052.30 rows=7893843 width=6) (actual
> time=210566.301..210566.301 rows=0 loops=1)
> Filter: ((small_id)::integer = ($1)::integer)
> Total runtime: 210566.411 ms
Well, there's the smoking gun all right. Why does it think there are
going to be 7893843 matching rows!? Could we see the pg_stats row for
the large.small_id column?
regards, tom lane
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2004-02-13 00:11:56 | Re: RFC: Query Planner making a distinction between Cross Database and Cross Schema ? |
| Previous Message | Simon Riggs | 2004-02-12 23:59:43 | Proposals for PITR |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | ow | 2004-02-13 00:25:48 | Re: 7.4 - FK constraint performance |
| Previous Message | Bruce Momjian | 2004-02-12 23:29:46 | Re: array_lower /array_prepend doubt |