Upload
vuongnhu
View
227
Download
6
Embed Size (px)
Citation preview
ProvideX
ADO and External Database EnhancementsPresented by: Brett Condy
Agenda• MySQL Improvements• ADO Interface
– What is it?– What are the benefits?– How is it used?– Performance comparison.
• Additional Enhancements
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.
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.
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.
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.
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
MySQL Improvements• The results from 62 reports with ProvideX files:
MySQL Improvements• The results from Version 8.31:
MySQL Improvements• Results using ReadNextLimit=100:
MySQL Improvements• Results using OPEN LOAD caching:
MySQL Improvements• Results using LIKE:
MySQL Improvements• Results using All Optimizations:
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.
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.
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.
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.
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
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
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.
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.
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
ADO Interface• Performance comparison
ADO Interface• Performance comparison
ADO Interface• Performance comparison
ADO Interface• Performance comparison
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).
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.
ProvideX
Q & A
ProvideX
End of Presentation
THANK YOU!