Re: Suppressing occasional failures in copy2 regression test

From: Gurjeet Singh <singh(dot)gurjeet(at)gmail(dot)com>
To: David Fetter <david(at)fetter(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Greg Stark <greg(dot)stark(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Suppressing occasional failures in copy2 regression test
Date: 2009-06-19 20:28:54
Message-ID: 65937bea0906191328n56fdd6f0m9ad1c310dcd8ac62@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jun 15, 2009 at 10:00 PM, David Fetter <david(at)fetter(dot)org> wrote:

> On Mon, Jun 15, 2009 at 11:34:38AM -0400, Tom Lane wrote:
> > David Fetter <david(at)fetter(dot)org> writes:
> > > * It's going to a lot of trouble to allow for the possibility of both
> > > unordered results and of duplicate lines. If we disallow duplicate
> > > lines in unordered result sets, we can get a big speed gain by using
> > > hash-based comparisons.
> >
> > Why not just sort the lines and compare?
>
> Good point :)
>

Please find attached the updated script and test cases. Changes since last
submission:

.) Script uses tabs for indentation.

.) Script almost passes perlcritic.com at 'stern' level.

.) Correct some RE matches, so that a ? mark only at the beginning of the
line matches (^ anchor).

.) Employ hybrid approach to support RE in unordered set, and to get better
performance:
If there's no RE line in an unordered group of lines then perform sort
on both arrays and then compare. If there _is_ an RE line in unordered group
of lines, then do the O(n^2) processing to eliminate common lines and then
report on missing lines.

TODO:

.) Using Tie::File to make code a little cleaner.

I agree that the choice of the hybrid approach for Unordered Set comparison
makes script too indented, and maybe a little hard on eyes, but it's pretty
simple and I have tried to delineate the major sections with proper
comments.

Best regards,
--
Lets call it Postgres

EnterpriseDB http://www.enterprisedb.com

gurjeet[(dot)singh](at)EnterpriseDB(dot)com
singh(dot)gurjeet(at){ gmail | hotmail | indiatimes | yahoo }.com
Mail sent from my BlackLaptop device

Attachment Content-Type Size
neurodiff.pl application/octet-stream 7.5 KB
expected.out application/octet-stream 337 bytes
result.out application/octet-stream 266 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2009-06-19 20:36:49 Re: Suppressing occasional failures in copy2 regression test
Previous Message Peter Eisentraut 2009-06-19 19:29:32 Re: rc1 tarball contains partially outdated/missing man pages