From: | Mark Lewis <mark(dot)lewis(at)mir3(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Ron Peacetree <rjpeace(at)earthlink(dot)net>, Simon Riggs <simon(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org, pgsql-performance(at)postgresql(dot)org |
Subject: | Re: [PERFORM] Releasing memory during External sorting? |
Date: | 2005-09-23 17:43:02 |
Message-ID: | 1127497383.23567.218.camel@archimedes |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers pgsql-performance |
operations != passes. If you were clever, you could probably write a
modified bubble-sort algorithm that only made 2 passes. A pass is a
disk scan, operations are then performed (hopefully in memory) on what
you read from the disk. So there's no theoretical log N lower-bound on
the number of disk passes.
Not that I have anything else useful to add to this discussion, just a
tidbit I remembered from my CS classes back in college :)
-- Mark
On Fri, 2005-09-23 at 13:17 -0400, Tom Lane wrote:
> Ron Peacetree <rjpeace(at)earthlink(dot)net> writes:
> > 2= No optimal external sorting algorithm should use more than 2 passes.
> > 3= Optimal external sorting algorithms should use 1 pass if at all possible.
>
> A comparison-based sort must use at least N log N operations, so it
> would appear to me that if you haven't got approximately log N passes
> then your algorithm doesn't work.
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
> choose an index scan if your joining column's datatypes do not
> match
From | Date | Subject | |
---|---|---|---|
Next Message | Bruce Momjian | 2005-09-23 17:53:14 | Re: [GENERAL] 8.1 observation |
Previous Message | Bruce Momjian | 2005-09-23 17:37:18 | Re: 2 forks for md5? |
From | Date | Subject | |
---|---|---|---|
Next Message | Chris Browne | 2005-09-23 17:48:32 | Re: VACUUM FULL vs CLUSTER |
Previous Message | Stef | 2005-09-23 17:18:03 | Re: VACUUM FULL vs CLUSTER |