Re: Navigation question

From: dawn <dawnwolthuis_at_gmail.com>
Date: 14 Feb 2007 16:47:14 -0800
Message-ID: <1171500434.672576.85780_at_s48g2000cws.googlegroups.com>


On Feb 14, 6:15 pm, "Marshall" <marshall.spi..._at_gmail.com> wrote:
> On Feb 14, 1:59 pm, "dawn" <dawnwolth..._at_gmail.com> wrote:
>
> > On Feb 14, 3:32 pm, "Marshall" <marshall.spi..._at_gmail.com> wrote:
> > I have not seen any
> > applications that execute exactly one or even only (unordered) sets of
> > SQL statements,
>
> Any two SQL queries where query B is parameterized by
> data retrieved by query A can be rewritten into a single
> query.

Yes, but that isn't how software is written, is it? Have you ever seen an entire application that does not navigate the database in this way at some point (and for good reason)?

> The rewritten single query will (absent pathological
> behavior in the query optimizer) be at least as fast as
> the sum of the two original queries, and possibly faster.

I'm not sure I believe that, but let's say it is true, then what. What does the application code then do with this cartesian crossproduct  of data? Include just one "property" of an entity where the property has multiple values, such as e-mail addresses. We want the name of the company an the list of contact e-mail addresses (let's say there are 5 for our example), plus the postal address of the HQ, in some "header" block on a data entry page and then a list of orders and dates below it (let's say there are 100). So we retrieve a view that includes one row per e-mail address per order, for 600 rows we need to now deconstruct for the screen. Have you ever seen this done? I'm interested in whether there are really any significant applications that do no navigation -- do you really think there are? Thanks. -- dawn

> Network utilization will necessarily be at least a little better.
>
> Marshall
Received on Thu Feb 15 2007 - 01:47:14 CET

Original text of this message