30
ProvideX ADO and External Database Enhancements Presented by: Brett Condy

ADO and External Database Enhancements - PVX Plus€“ ADO is an acronym for ActiveX Data Objects • It is a Component Object Model (COM) object used to access data sources

Embed Size (px)

Citation preview

Page 1: ADO and External Database Enhancements - PVX Plus€“ ADO is an acronym for ActiveX Data Objects • It is a Component Object Model (COM) object used to access data sources

ProvideX

ADO and External Database EnhancementsPresented by: Brett Condy

Page 2: ADO and External Database Enhancements - PVX Plus€“ ADO is an acronym for ActiveX Data Objects • It is a Component Object Model (COM) object used to access data sources

Agenda• MySQL Improvements• ADO Interface

– What is it?– What are the benefits?– How is it used?– Performance comparison.

• Additional Enhancements

Page 3: ADO and External Database Enhancements - PVX Plus€“ ADO is an acronym for ActiveX Data Objects • It is a Component Object Model (COM) object used to access data sources

MySQL Improvements• New OPEN LOAD syntax

– Provides the ability to locally cache a MySQL Table.

– Helpful when an application continually issues READs on smaller, static files (e.g. Territory or Sales Person file).

– Attempts to update OPEN LOADed files will result in an Error #13: File access mode invalid.

Page 4: ADO and External Database Enhancements - PVX Plus€“ ADO is an acronym for ActiveX Data Objects • It is a Component Object Model (COM) object used to access data sources

MySQL Improvements• ReadNextLimit

– Imposes a secondary LIMIT when issuing a read-next.

– Can significantly reduce number of rows read for SELECTs and READs when reading to the end of file is not required.

– The initial SELECT will not impose a LIMIT, however, once the result set has been exhausted, subsequent SELECT statements will (optionally) include a LIMIT.

Page 5: ADO and External Database Enhancements - PVX Plus€“ ADO is an acronym for ActiveX Data Objects • It is a Component Object Model (COM) object used to access data sources

MySQL Improvements• ReadNextLimit Example:

READ (APInv,KEY=Div$+Vend$,DOM=*NEXT) ! Positional READNextRec:

READ (APInv,END=Done)k$=KEC(APInv); IF k$(1,9)>Div$+Vend$ THEN GOTO DonePRINT VendorNo$; GOTO NextRec

– Prior to ReadNextLimit, the final READ would generate:SELECT * FROM APInv WHERE APDiv = '00' AND VendNo > 'ABC'

ORDER BY APDiv,VendNo,InvNo

• This would result in reading every invoice for every vendor following ABC – which could easily be thousands of rows!

– The ReadNextLimit would generate:SELECT * FROM APInv WHERE APDiv = '00' AND VendNo > 'ABC'

ORDER BY APDiv,VendNo,InvNoLIMIT 100

• This can significantly reduce the size of the result set.

Page 6: ADO and External Database Enhancements - PVX Plus€“ ADO is an acronym for ActiveX Data Objects • It is a Component Object Model (COM) object used to access data sources

MySQL Improvements• Enhanced WHERE clause generation

– Parsing of the BEGIN and END values on a SELECT has been enhanced to generate a more optimal WHERE clause.

• This can include:– A range for a specific column.– The use of the LIKE qualifier.

Page 7: ADO and External Database Enhancements - PVX Plus€“ ADO is an acronym for ActiveX Data Objects • It is a Component Object Model (COM) object used to access data sources

MySQL Improvements• Enhanced WHERE clause generation

Vendor$="ADA8296"InvFrom$="000001",InvTo$="999999"SELECT * FROM APInv BEGIN Vendor$:InvFrom$ END Vendor$:InvTo$

PRINT VendorNo$," ",InvoiceNo$," ",InvoiceDate$NEXT RECORD

• Prior versions would generate:SELECT * FROM APInv

WHERE VendorNo = 'ADA8296' AND InvoiceNo > '000001'ORDER BY VendorNo,InvoiceNo

• V9.00 will generate:SELECT * FROM APInv

WHERE VendorNo= 'ADA8296' AND InvoiceNo >= '000001'AND InvoiceNo <= '999999'

ORDER BY VendorNo,InvoiceNo

Page 8: ADO and External Database Enhancements - PVX Plus€“ ADO is an acronym for ActiveX Data Objects • It is a Component Object Model (COM) object used to access data sources

MySQL Improvements• The results from 62 reports with ProvideX files:

Page 9: ADO and External Database Enhancements - PVX Plus€“ ADO is an acronym for ActiveX Data Objects • It is a Component Object Model (COM) object used to access data sources

MySQL Improvements• The results from Version 8.31:

Page 10: ADO and External Database Enhancements - PVX Plus€“ ADO is an acronym for ActiveX Data Objects • It is a Component Object Model (COM) object used to access data sources

MySQL Improvements• Results using ReadNextLimit=100:

Page 11: ADO and External Database Enhancements - PVX Plus€“ ADO is an acronym for ActiveX Data Objects • It is a Component Object Model (COM) object used to access data sources

MySQL Improvements• Results using OPEN LOAD caching:

Page 12: ADO and External Database Enhancements - PVX Plus€“ ADO is an acronym for ActiveX Data Objects • It is a Component Object Model (COM) object used to access data sources

MySQL Improvements• Results using LIKE:

Page 13: ADO and External Database Enhancements - PVX Plus€“ ADO is an acronym for ActiveX Data Objects • It is a Component Object Model (COM) object used to access data sources

MySQL Improvements• Results using All Optimizations:

Page 14: ADO and External Database Enhancements - PVX Plus€“ ADO is an acronym for ActiveX Data Objects • It is a Component Object Model (COM) object used to access data sources

ADO Interface• What is it?

– ADO is an acronym for ActiveX Data Objects

• It is a Component Object Model (COM) object used to access data sources.

• The ADO layer provides an interface between a ProvideX application and MS SQL Server using OLE DB (Object Linking and Embedding Database).

• As it utilizes COM technology, it is limited to the Windows platform.

Page 15: ADO and External Database Enhancements - PVX Plus€“ ADO is an acronym for ActiveX Data Objects • It is a Component Object Model (COM) object used to access data sources

ADO Interface• What are the benefits?

– Overall performance is significantly better than ODB.• Uses OLE DB rather than the ODBC Administrator.

– Additional performance features• Supports the ability to cache tables.• SELECT / NEXT RECORD parsing includes improved

generation of SQL statements.• Supports Client or Server side cursors.

Page 16: ADO and External Database Enhancements - PVX Plus€“ ADO is an acronym for ActiveX Data Objects • It is a Component Object Model (COM) object used to access data sources

ADO Interface• How is it used?

– The ADO interface is almost identical to ODB.

• Primarily from a syntax and usability standpoint.

• Uses a new [ADO] prefix to access tables.

• TCB(190) can be used to determine if ADO support is available.

• MID(FIB(chan),19,1) reports a lower case 'a' for ADO tables.

Page 17: ADO and External Database Enhancements - PVX Plus€“ ADO is an acronym for ActiveX Data Objects • It is a Component Object Model (COM) object used to access data sources

ADO Interface• How is it used?

– Options can be specified on the OPEN or from an INI file

• INI options are identified in a section called [ADO].

• INI settings are used as the initial defaults.

• Options specified on the OPEN override INI settings.

Page 18: ADO and External Database Enhancements - PVX Plus€“ ADO is an acronym for ActiveX Data Objects • It is a Component Object Model (COM) object used to access data sources

ADO Interface• How is it used?

– The following table outlines options that are available in both ADO and ODB:

StdDateNoStripKeyDB / Qualifier

SharedNoNumAdjIsolationDateFmt

UserSchemaNoNullsINDCursor_TypeUniqueRecDataMaxRowsIgnore_NoDataCursorClose

TypRecMAS90SetFactsDtConnectTimeOutPswdMAS90DateExtrOptConcurrencyTextMaxPosUpdateKeySet_SizeExec_SPRNOAutoCommit

StripNullPadKeyKeyDataDebugItAccess

Page 19: ADO and External Database Enhancements - PVX Plus€“ ADO is an acronym for ActiveX Data Objects • It is a Component Object Model (COM) object used to access data sources

ADO Interface• How is it used?

– Options that differ from ODB:• Cursor_Use= { Client | Server }

– Indicates whether to use Client or Server side cursors with Client being the default

• TOP = -2– A setting of -2 allows driver to optimize the number of rows retrieved

based on the type of operation being performed.• TSQL= *ForwardSecondary*

– Used for joined / detail table processing » e.g. Order Header and Detail where Detail could be ForwardSecondary

– All operations are expected to be forward minded– Must be used with an OPEN LOAD

Page 20: ADO and External Database Enhancements - PVX Plus€“ ADO is an acronym for ActiveX Data Objects • It is a Component Object Model (COM) object used to access data sources

ADO Interface• How is it used?

– Options that are new to ADO:• CacheSize

– Sets size of the OPEN LOAD cache in megabytes with a default of 1 MB.

• IdentDelim– Character(s) used to enclose table and column names.

» If a single character is specified (e.g. ' or "), then this character will be used both before and after the identifier name.

» If two characters are specified (e.g. "[]"), then the first character will be used before the identifier name, and the second will be used after the identifier name.

• UseSQLLocks– Indicates whether to use SQL Server application locks for

LOCK, UNLOCK and OPEN LOCK directives. SQL locks are enabled by default.

Page 21: ADO and External Database Enhancements - PVX Plus€“ ADO is an acronym for ActiveX Data Objects • It is a Component Object Model (COM) object used to access data sources

ADO Interface• How is it used?

– Options that are new to ADO:

• KeyCacheTime– Allows rows from a table to be cached for a specified number

of milliseconds.– Applies only to files not OPEN LOAD'ed.– Default of zero disables this feature.

• ReadNextLimit– Imposes a secondary LIMIT when issuing a read-next.– Can significantly reduce number of rows read for SELECTs

and READs when reading to the end of file is not required.– If an optimum limit is not known then using a TOP=-2 would

produce better results.

Page 22: ADO and External Database Enhancements - PVX Plus€“ ADO is an acronym for ActiveX Data Objects • It is a Component Object Model (COM) object used to access data sources

ADO Interface• Sample / recommended INI settings:

[ADO]# Required for correct extract locking with read through ability on # other channelsEXTROPT=' (UPDLOCK)'CURSOR_USE=SERVERCURSORCLOSE=YESTOP=-2# DYNAMIC is slower, and is of no benefit given how ProvideX uses # cursorsCURSOR_TYPE=FORWARDTIMEOUT=5# Unique should be set to 1. Otherwise connections will be shared # and could result in a performance hit managing the share handles.UNIQUE=1ISOLATION=COMMITEDAUTOCOMMIT=ONTEXTMAX=8192

Page 23: ADO and External Database Enhancements - PVX Plus€“ ADO is an acronym for ActiveX Data Objects • It is a Component Object Model (COM) object used to access data sources

ADO Interface• Performance comparison

Page 24: ADO and External Database Enhancements - PVX Plus€“ ADO is an acronym for ActiveX Data Objects • It is a Component Object Model (COM) object used to access data sources

ADO Interface• Performance comparison

Page 25: ADO and External Database Enhancements - PVX Plus€“ ADO is an acronym for ActiveX Data Objects • It is a Component Object Model (COM) object used to access data sources

ADO Interface• Performance comparison

Page 26: ADO and External Database Enhancements - PVX Plus€“ ADO is an acronym for ActiveX Data Objects • It is a Component Object Model (COM) object used to access data sources

ADO Interface• Performance comparison

Page 27: ADO and External Database Enhancements - PVX Plus€“ ADO is an acronym for ActiveX Data Objects • It is a Component Object Model (COM) object used to access data sources

Additional Enhancements

• Added support for FIN(chan, "Key_Definition")• For [MySQL], [ODB] and [ADO] interfaces

• Changed [OCI] to follow other external databases.– Sub-stringed numerics now default to left justification (not

right justification). – A new OPEN option RIGHTNUMS has been added to

turn on right justification (for backward compatibility).

Page 28: ADO and External Database Enhancements - PVX Plus€“ ADO is an acronym for ActiveX Data Objects • It is a Component Object Model (COM) object used to access data sources

Additional Enhancements

• Data Dictionary Maintenance– can extract column information from MySQL tables.

• ADO Database Object• Added direct MySQL support to the Views system.• Query Definition

– Queries can be defined with an external database table using the Server;Database syntax as the 'Data Base Name'.

– Also supports external database tables with named keys.

Page 29: ADO and External Database Enhancements - PVX Plus€“ ADO is an acronym for ActiveX Data Objects • It is a Component Object Model (COM) object used to access data sources

ProvideX

Q & A

Page 30: ADO and External Database Enhancements - PVX Plus€“ ADO is an acronym for ActiveX Data Objects • It is a Component Object Model (COM) object used to access data sources

ProvideX

End of Presentation

THANK YOU!