Limits of arrays

From: "Harald Armin Massa" <haraldarminmassa(at)gmail(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Limits of arrays
Date: 2006-09-19 13:45:25
Message-ID: 7be3f35d0609190645n3708ad95ne609d8e576668227@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I found a rather strange but working method to compare the contents of two
tables in different databases:

select 'otformularfeld' as which, md5(array_to_string(array(
select md5(id_pkff||id_formular||id_formfeld||id_bf) from otformularfeld
where quarant=0 order by id_pkff
),''))

So:
- basically I take the relevant columns from a table
- cast them to text and concattenate the strings
- find the md5 hash of this row
- then take the md5 of all rows, concattenate them to string
- and finally find the md5 of this string

That works surprisingly fast and gives a quick check "data in those 2 tables
is the same or not".

Now, the maximum rowcount in one table so far is 180000; and still there is
no crash. Are there limits for the maximum "rows" in one arrays?
Limits the maximum length of one string?

The only near information I could find in the documentations was "1 GB per
field", which will propably be the size limit for the array and the string.
Are there more limits?

Or is that md5 / concattenation process done in an iterative manner, that
is: all the intermediate results are consumed and not cached in memory?

Harald

--
GHUM Harald Massa
persuadere et programmare
Harald Armin Massa
Reinsburgstraße 202b
70197 Stuttgart
0173/9409607
-
Let's set so double the killer delete select all.
--
GHUM Harald Massa
persuadere et programmare
Harald Armin Massa
Reinsburgstraße 202b
70197 Stuttgart
0173/9409607
-
Let's set so double the killer delete select all.

Browse pgsql-general by date

  From Date Subject
Next Message Bill Moran 2006-09-19 13:49:21 Re: vista
Previous Message Alban Hertroys 2006-09-19 13:44:25 Re: unique key issue