Re: putting CHECK_FOR_INTERRUPTS in qsort_comparetup()

From: "Charles Duffy" <charles(dot)duffy(at)gmail(dot)com>
To: "Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: putting CHECK_FOR_INTERRUPTS in qsort_comparetup()
Date: 2006-07-14 06:29:14
Message-ID: dfdaea8f0607132329q4bab7012k285cff911e8d693d@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Qingqing,

On 7/12/06, Qingqing Zhou <zhouqq(at)cs(dot)toronto(dot)edu> wrote:

> >
> How long is that "unacceptably long time"?
>

30 seconds.

> the problem here is that 29247 doesn't look like a big number so I can't see
> why your patch solved the problem, unless the qsort_comparetup() function of
> the data type eats too many circles or the cpu is too slow.

Well...when exhibiting the problem, execution stays inside qsort() for
the entire 'delay period' - I don't think its off in some other recess
which is also lacking in interrupt flag checking.

As for the CPU - the machine is a 4 way Opteron, and otherwise
performs well. It does seem odd that the in-memory sort takes as long
as it does - the plan may suggest a reason.

And - the patched version doesn't exhibit the problem.

> I just did a
> test to invoke a qsort on an "integer" field of a table with 5 million rows,
> and sent a SIGINT, the delay is 7 or 8 seconds. I suspect there are some
> other places doesn't check interrupts -- what's your query plan?

Plan attached.

Thanks,

Charles Duffy

Attachment Content-Type Size
explain_analyze_output.txt text/plain 9.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Lukas Smith 2006-07-14 06:47:12 Re: monolithic distro
Previous Message Katsuhiko Okano 2006-07-14 05:58:36 Re: poor performance with Context Switch Storm at TPC-W.

Browse pgsql-patches by date

  From Date Subject
Next Message Peter Eisentraut 2006-07-14 07:49:27 Re: [DOCS] maintenance diff
Previous Message Katsuhiko Okano 2006-07-14 05:58:36 Re: poor performance with Context Switch Storm at TPC-W.