temp-table performance tuning & other important stuff dan foreman progress bravepoint...

28
TEMP-TABLE Performance Tuning & Other Important Stuff Dan Foreman Progress BravePoint [email protected]

Upload: ariel-bates

Post on 22-Dec-2015

231 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: TEMP-TABLE Performance Tuning & Other Important Stuff Dan Foreman Progress BravePoint dforeman@BravePoint.com

TEMP-TABLE Performance Tuning & Other Important Stuff

Dan Foreman

Progress BravePoint

[email protected]

Page 2: TEMP-TABLE Performance Tuning & Other Important Stuff Dan Foreman Progress BravePoint dforeman@BravePoint.com

Introduction- Dan Foreman

Progress user since 1984

This year is my 30 year anniversary with Progress

Guest Speaker at dozens of Progress Conferences 1990 until Today

Page 3: TEMP-TABLE Performance Tuning & Other Important Stuff Dan Foreman Progress BravePoint dforeman@BravePoint.com

Dan Foreman Publications

Progress Performance Tuning Guide

Progress Database Admin Guide

Progress System Tables Guide

All updated through V11.3

Hope to have them in ePub and/or Kindle format in the next few months

Page 4: TEMP-TABLE Performance Tuning & Other Important Stuff Dan Foreman Progress BravePoint dforeman@BravePoint.com

Who Are You?

Progress V6, V7, V8, V9, V10, V11

Page 5: TEMP-TABLE Performance Tuning & Other Important Stuff Dan Foreman Progress BravePoint dforeman@BravePoint.com

Miscellaneous

Mobile phones on silent or vibrate please

TT = Temp Table

V11 = OE11

Page 6: TEMP-TABLE Performance Tuning & Other Important Stuff Dan Foreman Progress BravePoint dforeman@BravePoint.com

To Do for Next TimeDoes monitoring EMPTY TEMP-TABLE “lie” about the number of records deleted?

Example showing dynamic temp-tables

Program to show all fields for the various “pseudo VSTs”

Why does tt-data1/3.p not show the dynamic TTs?

What are the mystery tables (count 2, peak 9) ????

Benchmark the overhead of turning on the TT monitors

Page 7: TEMP-TABLE Performance Tuning & Other Important Stuff Dan Foreman Progress BravePoint dforeman@BravePoint.com

Before TT there were WORK-FILEs

100% Memory resident

No indexes

Record access is sequentialFIND FIRST > FIND LAST > FIND FIRST

Increasing the size of a record can be very expensive

Can potentially crash a system with three 4GL statements…….

Page 8: TEMP-TABLE Performance Tuning & Other Important Stuff Dan Foreman Progress BravePoint dforeman@BravePoint.com

Temp-Table Basics

Similar to DB Tables

CRUD (Create, Read, Update, Delete)

Changes are not logged to the Before Image or After Image files

Subject to LBI activity unless NO-UNDO is used

Type 2 Storage “Areas”

No record locking

No latching (in DB shared memory)

Page 9: TEMP-TABLE Performance Tuning & Other Important Stuff Dan Foreman Progress BravePoint dforeman@BravePoint.com

TEMP-TABLE Basics

TT data is written to a Client temporary file with a DBI prefix

DBI file is similar to a “real” DB but with no AI, BI, LG, LK files

Location of Client Temp Files can be set with –T parameter

Temp Files are hidden on Win & Unix Unix/Linux: -t

Windows: DIR /ah

Page 10: TEMP-TABLE Performance Tuning & Other Important Stuff Dan Foreman Progress BravePoint dforeman@BravePoint.com

Emptying a TEMP-TABLE

EMPTY TEMP-TABLE tablename

Much faster than a Loop

Page 11: TEMP-TABLE Performance Tuning & Other Important Stuff Dan Foreman Progress BravePoint dforeman@BravePoint.com

NO-UNDO

NO-UNDO on the TEMP-TABLE Definition

If NO-UNDO isn’t used, changes to TT inside of a transaction are logged to a Client Temp file with lbi prefix

Page 12: TEMP-TABLE Performance Tuning & Other Important Stuff Dan Foreman Progress BravePoint dforeman@BravePoint.com

TT Startup Options

-tmpbsize – the block size used for the TT “database”

Client Startup Parameter

The default has changed more than once so we recommend setting it explicitly

-tmpbsize 8 recommended

-Bt – memory buffers for Temp-TablesClient Startup Parameter

Memory = (-Bt * -tmpbsize) * (# of Clients)

Page 13: TEMP-TABLE Performance Tuning & Other Important Stuff Dan Foreman Progress BravePoint dforeman@BravePoint.com

Pre-V11 TT Monitoring Options

None – at least nothing that’s built in

Monitoring the size of the DBI file is about the only useful metric available

Page 14: TEMP-TABLE Performance Tuning & Other Important Stuff Dan Foreman Progress BravePoint dforeman@BravePoint.com

V11 Delayed TT Instantiation

The app doesn't incur the overhead of instantiating a TT until it's actually referenced

The pre-V11 model instantiates all TT's when a new program is run, regardless of whether they are referenced or not

Use -nottdelay to revert to the old functionality

Page 15: TEMP-TABLE Performance Tuning & Other Important Stuff Dan Foreman Progress BravePoint dforeman@BravePoint.com

Temp Table Logging

“The OpenEdge Logging Infrastructure has been enhanced so that application developers can trace the creation and deletion of temp-tables in their applications. This logging capability strengthens the ability to troubleshoot applications that utilize temp-tables and ProDataSets as their primary data structures.”

Page 16: TEMP-TABLE Performance Tuning & Other Important Stuff Dan Foreman Progress BravePoint dforeman@BravePoint.com

VSTs for Temp Tables

“This ABL enhancement allows clients to gather information about the temp-tables used by the application via Virtual System Tables. These tables give the application access to database activity and status information, enabling an application to understand, debug, and tune the use of temp-tables within their application at runtime.”

Page 17: TEMP-TABLE Performance Tuning & Other Important Stuff Dan Foreman Progress BravePoint dforeman@BravePoint.com

Progress.Database.TempTableInfo Class

“Provides information about a

temp-table and its indexes and provides static properties and methods for retrieving and archiving temp-table information for an ABL session”

Page 18: TEMP-TABLE Performance Tuning & Other Important Stuff Dan Foreman Progress BravePoint dforeman@BravePoint.com

TempTableInfo Properties

ArchiveIndexStatistics

ArchiveTableStatistics

TempTableCount

TempTablePeak

Page 19: TEMP-TABLE Performance Tuning & Other Important Stuff Dan Foreman Progress BravePoint dforeman@BravePoint.com

TempTableInfo Methods

GetIndexInfoByID()

GetIndexStatHistoryHandle( )

GetTableInfoByID( )

GetTableStatHistoryHandle( )

GetTableInfoByPosition( )

GetVSTHandle( )

Page 20: TEMP-TABLE Performance Tuning & Other Important Stuff Dan Foreman Progress BravePoint dforeman@BravePoint.com

Starter CodeUSING Progress.Database.*.

Progress.Database.TempTableInfo:ArchiveTableStatistics = YES.Progress.Database.TempTableInfo:ArchiveIndexStatistics = YES.

Page 21: TEMP-TABLE Performance Tuning & Other Important Stuff Dan Foreman Progress BravePoint dforeman@BravePoint.com

Instant ErrorCannot set Progress.Database.TempTableInfo:ArchiveTableStatistics (15247)

So you lookup Message# 15247:

“Update to the property or field is not allowed. This can happen if the given object only provides read-only access to the property based on its state.”

What ????

Page 22: TEMP-TABLE Performance Tuning & Other Important Stuff Dan Foreman Progress BravePoint dforeman@BravePoint.com

V11 Client Startup Parameters

-ttbasetable

-tttablerangesizeDefault is 0; no statistics are recorded

Default for the DB –tablerangesize is 50

Page 23: TEMP-TABLE Performance Tuning & Other Important Stuff Dan Foreman Progress BravePoint dforeman@BravePoint.com

V11 Client Startup Parameters

-ttbaseindex

-ttindexrangesizeDefault is 0; no statistics are recorded

Default for the DB –indexrangesize is 50

Page 24: TEMP-TABLE Performance Tuning & Other Important Stuff Dan Foreman Progress BravePoint dforeman@BravePoint.com

Try Again

Using this .pf file

-ttbaseindex 1-ttindexrangesize 100-ttbasetable 1-tttablerangesize 100

Page 25: TEMP-TABLE Performance Tuning & Other Important Stuff Dan Foreman Progress BravePoint dforeman@BravePoint.com

Progress.Database.VSTTableId Class

“Provides static properties that identity the VST for returning specific temp-table information for an ABL session”

Page 26: TEMP-TABLE Performance Tuning & Other Important Stuff Dan Foreman Progress BravePoint dforeman@BravePoint.com

VSTTableId PropertiesActBufferId

ActIOTypeId

ActSpaceId

BuffStatusId

IndexStatId

TableStatId

UserIndexStatId

ActIndexId

ActOtherId

ActSummaryId

DbStatusId

MstrBlkId

TransId

UserTableStatId

ActIOFileId

ActRecordId

BlockId

FileListId

StatBaseId

UserIOId

Page 27: TEMP-TABLE Performance Tuning & Other Important Stuff Dan Foreman Progress BravePoint dforeman@BravePoint.com

Demonstration

basic.p

tt2.p

tt-data1.p

Page 28: TEMP-TABLE Performance Tuning & Other Important Stuff Dan Foreman Progress BravePoint dforeman@BravePoint.com

Questions?

Questions?

Conference Evaluations

Thank You!

Contact:Dan Foreman

[email protected]

+1 541 908 3437 (but not right now please)