Re: Sorting Tuples

From: "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com>
To: Manolo <manolo(dot)espa(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Sorting Tuples
Date: 2008-03-13 15:11:32
Message-ID: 36e682920803130811n15180bcn296f457676279554@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Thu, Mar 13, 2008 at 7:25 AM, Manolo <manolo(dot)espa(at)gmail(dot)com> wrote:
> I created a patch for PostgreSQL even if i'm not a PostgreSQL user. I
> just wanted to implement an idea for possibly getting better External
> Sorting module on PostgreSQL just using some basic C programming
> knowledge and now I'm facing to using PostgreSQL for a while in order to
> test my patch.

OK.

> My patch "activates" when user is trying to sort a load of data more or
> less twice bigger than his available memory (e.g.: sorting 5GB of data
> just disposing of 1GB of available memory)

OK, we kinda already have that covered.

> PROBLEM:
> First of all I want to realise my patch does sorts correctly or not. But
> it's a little bit difficult to check when
>
> SELECT * FROM huge_table ORDER BY a_column_of_huge_table;
>
> means checking a 4 or 5 GB result...

5GB is nothing, but I'll continue...

> QUESTION:
> Is there a way to discover if data is sorted correctly other than
> spending 2 months taking a look to the 5 GB result tuples, one by one?

I'm trying to understand this. You wrote a patch to improve external
sorting... and, you're not sure how to test whether it sorted
correctly? I don't mean to be rude, but am I missing something here?

To your question, just sort the output and run checksums against the
output for comparison.

--
Jonah H. Harris, Sr. Software Architect | phone: 732.331.1324
EnterpriseDB Corporation | fax: 732.331.1301
499 Thornall Street, 2nd Floor | jonah(dot)harris(at)enterprisedb(dot)com
Edison, NJ 08837 | http://www.enterprisedb.com/

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Kasia Tuszynska 2008-03-13 16:21:04 Re: little bug in 8.3?
Previous Message Manolo 2008-03-13 13:52:36 Re: Sorting Tuples