× 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.



Steve,

Start: asnview definition --------------
WITH CteAsn AS
(SELECT outnum,
CASE WHEN suptyp = 'AS'
AND supnum = '02'
THEN 'AS'
ELSE ' '
END AS asnflag
FROM basdbc1/om08)
SELECT om01.outloc, om01.outnum, om01.adrlin1,
om01.adrlin3, om01.adrlin4, CteAsn.asnflag
FROM basdbc1/om01
LEFT JOIN CteAsn
ON om01.outnum = CteAsn.outnum
WHERE CteAsn.asnflag = 'AS'
-- ORDER BY 1,2
;
End : asnview definition --------------

Steve, you will note the commented ORDER BY; so this is the
original sql statement ysed to create the view which is
identical except the view lacks ORDER BY.

When running from Run Sql Statements, I ran the sql above and
compared the results with the following:

Start: sql statement using asnview --------------
SELECT *
FROM basloc53/om01asn
End : sql statement using asnview --------------

As you suggest, subsequent runs of both sql statements
show improvement over initial runs.

My testing was always within the same job, whether
using Run SQL Statement or RUNSQL.

Reading your question about separate jobs, I repeated
the initial "tests" in new Run Sql Statements session
and this time get:

Very little difference in run time, with the SELECT
against the View generally slightly "slower" than the
"full" SQL statement. The difference generally 10-30
ms: not detectable without stats from Run Sql . . .

:)

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Needles,Stephen J
Sent: Wednesday, July 31, 2013 1:33 PM
To: Midrange Systems Technical Discussion
Subject: RE: Sql statement vs Sql View performance

An sql view is a runtime event, not a permanent object. If you are looking for speed...you also would need appropriate indexes on the tables that comprise the view. If you are looking for permanence...redefine the view as an index.

Can you provide an example of how the asnview view is defined?

Do subsequent runs of the select over the view improve over the first time run in the job?

Where your tests comparing the non-view runs and those over the view conducted in separate jobs? If not, the open access paths may have caused some issues in the time comparisons.

Steve Needles


-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Gary Thompson
Sent: Wednesday, July 31, 2013 10:15 AM
To: Midrange Systems Technical Discussion
Subject: Sql statement vs Sql View performance

I have an SQL statement I use to list current customers requiring an EDI 856 ASN for delivery.

I created a view to make this "list" readily available.

An Sql statement (select * from asnview) against the view runs slower than the Sql statement the view is based on; requiring about 20x time using Sys i Nav Run SQL Scripts stats ?

(time diff not noticeable in runsql)

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l.

________________________________
This communication, including attachments, is confidential, may be subject to legal privileges, and is intended for the sole use of the addressee. Any use, duplication, disclosure or dissemination of this communication, other than by the addressee, is prohibited. If you have received this communication in error, please notify the sender immediately and delete or destroy this communication and all copies.

TRVDiscDefault::1201

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.