× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



There are certain classes of operations where native I/O (SETLL,
CHAIN,
etc.) is faster, often much faster, than SQL.

We've beaten this to death, and I won't disagree, with (of course) one
caveat. Yes, single-row IO is faster in native, but w/SQL you may have
many fewer IOs. Take, for example, loading an order-detail subfile. Say
you show line#, item#, ordered-quantity, item-description and price.

In HLL-mode you'd setll to the order-detail file, and read each row.
Then, for each detail line, you'd chain to the item file to get the
description and then setgt/readpe to the item-price table to get the
price effective on the order date, and repeat for each of the detail
lines. So you have the IOs for the detail lines, plus a single-row read
on item and a single-row read on item-price.

If you did the same process in SQL then the native IO would be clearly
faster. But, you shouldn't use the same process, you should rethink the
process and use a single statement to get it all:

Select OL.OrderLine, OL.Item#, I.Description,
(select top 1 IP.Price from ItemPrice IP
where IP.Item# = I.Item#
and IP.EffDate = O.OrderDate)
From OrderLine OL
Join Order O
on OL.Order# = O.Order#
Join Item I
on OL.Item# = I.Item#
Where OL.Order# = 12345

-Walden


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.