Re: Navigation question

From: Bob Badour <bbadour_at_pei.sympatico.ca>
Date: Fri, 16 Feb 2007 01:42:07 GMT
Message-ID: <PZ7Bh.7079$R71.105835_at_ursa-nb00s0.nbnet.nb.ca>


Marshall wrote:

> On Feb 15, 4:11 pm, "dawn" <dawnwolth..._at_gmail.com> wrote:
>

>>On Feb 15, 4:51 pm, "Marshall" <marshall.spi..._at_gmail.com> wrote:

[snip]

>>Whether working with VSAM files, Pick, or SQL-DBMS's,
>>this approach has worked and has never been contested by anyone as
>>being either difficult to maintain or to perform poorly.

In the above, she exposes her own ignorance.

> If your tables are a hundred rows it makes no noticable perfomance
> differences if you fetch them one at a time or all at once. There's
> no perceptible difference between an O(n log n), O(n^2), or O(n^3)
> algorithm
> if n is small enough. As n grows, so does the difference.

I once inherited a piece of code that had an inherently O(n^5) fetch/loop/fetch/loop/fetch/loop construct. I immediately replaced the deeply nested loops with a single select query as soon as I saw it. The select query, in spite of querying a view and using a sub-select, executed O(n).

A week later, my boss asked me to look into a performance problem in the code that had been reported in the field. He nearly fell out of his seat when I told him I already fixed it.

> If you have a three level deep static hierarchy, with 10^4 rows in
> the outer table and 10^4 fanout at each level, and you want to
> aggregate across the lowest level grouped by the highest level,
> the difference between doing a sum in a single query and a nested
> lookup execution is a factor of 10^8 network bandwidth and
> 10^12 packet count. It can mean the differerence between
> getting an answer in 5 seconds vs. days.

Yep.

> I have encountered much larger problems in the field; this
> is not even extreme.

Why do you bother with Dawn? It is so painfully obvious that she's just grinding her axe and promoting herself at tremendous cost to anyone she manages to dupe. Received on Fri Feb 16 2007 - 02:42:07 CET

Original text of this message