Very Slow Access Time for KSAM-XL File

Boyle, Joe Joe.Boyle@cognos.com
Thu, 11 Oct 2001 11:08:17 +0100


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C1523C.A578D740
Content-Type: text/plain

Hi Katie,

given that you have the key segment( c-index ) field on the screen you need
not specify anything else and PH will create all of the required path and
find code by default, see example below. 
The temporary fields are not required as select access is invariably much
slower that keyed access, and as someone else mentioned you need not use an
end key vale as the user can simply start a new find sequence or stop
pressing return.

You can then simply press return to sequentially scroll through all of the
data or enter a value such as "c@" to retrieve all keys starting with "c" or
enter a value such as "c@@" to retrieve all keys starting with "c" to the
end of the file as mentioned in Matt's email. 

I used the source code below, where last-name is a key segment of an
alternate index,

  can cle
  set default
  scre a1
  file EMPLOYEES prim
  field last-name
  build list detail

and powerhouse generates the internal code below,

> PROCEDURE ENTRY
>   BEGIN
>     ACCEPT LAST-NAME OF EMPLOYEES
>     END
> PROCEDURE PATH
>   BEGIN
>     REQUEST LAST-NAME OF EMPLOYEES
>     IF PROMPTOK
>       THEN LET PATH = 1
>     IF PATH = 0
>       THEN BEGIN
>         LET PATH = 2
>         END
>     END
> PROCEDURE FIND
>   BEGIN
>     IF PATH = 1
>       THEN GET EMPLOYEES VIAINDEX LAST-NAME VIA LAST-NAME
>     IF PATH = 2
>       THEN GET EMPLOYEES SEQUENTIAL
>     END
> PROCEDURE UPDATE
>   BEGIN
>     PUT EMPLOYEES
>     END
> PROCEDURE DELETE
>   BEGIN
>     DELETE EMPLOYEES
>     END


regards,
Joe Boyle.
____________________________________________________
Software specialist.
Cognos Customer Support UK.  
Cognos Ltd.                   Phone:         +44 / (0)1344 / 707 799
Westerly Point                   Fax:         +44 / (0)1344 / 707 962
____________________________________________________
Market Street                       e-mail:   Joe.Boyle@cognos.com
Bracknell                       Homepage:   http://www.cognos.com
Cognos                   Support Page:   http://support.cognos.com

Cognos Limited. Registered in England, number 1635598.  Registered office:
Westerly Point, Market Street, Bracknell, Berkshire, RG12 1QB

This e-mail may contain confidential information and is confidential to the
user of the e-mail address to which it is addressed.  No-one else may copy
or forward all or any of this e-mail in any form.  If you receive this
e-mail in error please destroy this message and notify the sender by return
e-mail.   

Please send any e-mail response regarding this communication to
support.uk@cognos.com and it will be directed to the specialist dealing with
your call. Please make sure that you include the call reference number in
the subject line of your e-mail.


-----Original Message-----
From: Katie Link [mailto:linkkati@isu.edu]
Sent: 10 October 2001 19:08
To: powerh-l@lists.swau.edu
Subject: Very Slow Access Time for KSAM-XL File


I'm using Quick and accessing a KSAM-XL file sequentially viaindex.
There are three indexes in this ksam file and I'm accessing using one of
the indexes.  I also use select with the file statement.  I'd like to
select records from the ksam file based on a range of values that I
request.  There are only 13,000 records in the ksam file but record
selection takes a very long time (I stopped the process after about 8
minutes).  Are there any suggestions for making this screen run faster?
I'm using PowerHouse 8.29D3 on an HP-3000 box.  I have included the
Quick code and ksam file structure below.  Thanks in advance

Quick code:

screen siqs activities find

temp beg-index char*10
temp end-index char*10

file crsksam primary
  access sequential viaindex c-index request beg-index, end-index
  select if c-index >= beg-index and c-index <= end-index

field beg-index
field end-index
skip 1
field c-index
field c-sess-crs-sec1

PROCEDURE PATH
  BEGIN
    REQUEST BEG-INDEX
    IF PROMPTOK
      THEN REQUEST END-INDEX
    IF PROMPTOK
      THEN LET PATH = 1
    IF PATH = 0
      THEN ERROR "Key/Index required."
    END

PROCEDURE FIND
  BEGIN
    GET CRSKSAM VIAINDEX C-INDEX SEQUENTIAL
    END

BUILD

KSAM file structure:

    Record:             CRSKSAM
    of File:            CRSKSAM
    Organization:       INDEXED
    Type:               KSAMXL   (ASCII)
    Open:               CRSKSAM
    Description:
             This file contains the index number related to each
combined
             session, department, course + section key and is used to
             retrieve course information via an index number which is
             easier to remember and faster to use.
    Record Size:        36 Bytes

-- Record Contents --
    Item                                 Type            Size  Occ
Offset
    C-INDEX                              CHARACTER          6
0
    C-SESS-CRS-SEC1                      CHARACTER         15
6
    .C-SESSION1                          CHARACTER          4
6
    .C-DEPT1                             CHARACTER          5
10
    .C-CRS1                              CHARACTER          4
15
    .C-SEC1                              CHARACTER          2
19
    C-SESS-CRS-SEC2                      CHARACTER         15
21
    .C-SESSION2                          CHARACTER          4
21
    .C-DEPT2                             CHARACTER          5
25
    .C-CRS2                              CHARACTER          4
30
    .C-SEC2                              CHARACTER          2
34

-- Index Contents --

 ** C-INDEX is a 6 byte   UNIQUE PRIMARY  index **


    Segment                              Type            Size  Ord
Offset
    C-INDEX                              CHARACTER          6    A
0


 ** C-SESS-CRS-SEC1 is a 15 byte  REPEATING ALTERNATE  index **


    Segment                              Type            Size  Ord
Offset
    C-SESS-CRS-SEC1                      CHARACTER         15    A
0


 ** C-SESS-CRS-SEC2 is a 15 byte  REPEATING ALTERNATE  index **


    Segment                              Type            Size  Ord
Offset
    C-SESS-CRS-SEC2                      CHARACTER         15    A
0




------_=_NextPart_001_01C1523C.A578D740
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">



RE: Very Slow Access Time for KSAM-XL File



Hi Katie,

given that you have the key segment( c-index ) field = on the screen you need not specify anything else and PH will create all = of the required path and find code by default, see example below. =

The temporary fields are not required as select = access is invariably much slower that keyed access, and as someone else = mentioned you need not use an end key vale as the user can simply start = a new find sequence or stop pressing return.

You can then simply press return to sequentially = scroll through all of the data or enter a value such as "c@" = to retrieve all keys starting with "c" or  enter a value = such as "c@@" to retrieve all keys starting with = "c" to the end of the file as mentioned in Matt's email. =

I used the source code below, where last-name is a = key segment of an alternate index,

  can cle
  set default
  scre a1
  file EMPLOYEES prim
  field last-name
  build list detail

and powerhouse generates the internal code = below,

> PROCEDURE ENTRY
>   BEGIN
>     ACCEPT LAST-NAME OF = EMPLOYEES
>     END
> PROCEDURE PATH
>   BEGIN
>     REQUEST LAST-NAME OF = EMPLOYEES
>     IF PROMPTOK
>       THEN LET = PATH =3D 1
>     IF PATH =3D 0
>       THEN = BEGIN
>         = LET PATH =3D 2
>         = END
>     END
> PROCEDURE FIND
>   BEGIN
>     IF PATH =3D 1
>       THEN GET = EMPLOYEES VIAINDEX LAST-NAME VIA LAST-NAME
>     IF PATH =3D 2
>       THEN GET = EMPLOYEES SEQUENTIAL
>     END
> PROCEDURE UPDATE
>   BEGIN
>     PUT EMPLOYEES
>     END
> PROCEDURE DELETE
>   BEGIN
>     DELETE EMPLOYEES
>     END


regards,
Joe Boyle.
____________________________________________________
Software specialist.
Cognos Customer Support UK. 
Cognos = Ltd.           &n= bsp;       = Phone:         +44 / (0)1344 / = 707 799
Westerly = Point           &= nbsp;       = Fax:         +44 / (0)1344 / = 707 962
____________________________________________________
Market = Street           =             = e-mail:   Joe.Boyle@cognos.com
Bracknell         =             =   Homepage:   http://www.cognos.com
Cognos         &nb= sp;         Support = Page:   http://support.cognos.com

Cognos Limited. Registered in England, number = 1635598.  Registered office:  Westerly Point, Market Street, = Bracknell, Berkshire, RG12 1QB

This e-mail may contain confidential information and = is confidential to the user of the e-mail address to which it is = addressed.  No-one else may copy or forward all or any of this = e-mail in any form.  If you receive this e-mail in error please = destroy this message and notify the sender by return = e-mail.  

Please send any e-mail response regarding this = communication to support.uk@cognos.com and it will be directed to the = specialist dealing with your call. Please make sure that you include = the call reference number in the subject line of your = e-mail.


-----Original Message-----
From: Katie Link [mailto:linkkati@isu.edu]
Sent: 10 October 2001 19:08
To: powerh-l@lists.swau.edu
Subject: Very Slow Access Time for KSAM-XL = File


I'm using Quick and accessing a KSAM-XL file = sequentially viaindex.
There are three indexes in this ksam file and I'm = accessing using one of
the indexes.  I also use select with the file = statement.  I'd like to
select records from the ksam file based on a range = of values that I
request.  There are only 13,000 records in the = ksam file but record
selection takes a very long time (I stopped the = process after about 8
minutes).  Are there any suggestions for making = this screen run faster?
I'm using PowerHouse 8.29D3 on an HP-3000 box.  = I have included the
Quick code and ksam file structure below.  = Thanks in advance

Quick code:

screen siqs activities find

temp beg-index char*10
temp end-index char*10

file crsksam primary
  access sequential viaindex c-index request = beg-index, end-index
  select if c-index >=3D beg-index and = c-index <=3D end-index

field beg-index
field end-index
skip 1
field c-index
field c-sess-crs-sec1

PROCEDURE PATH
  BEGIN
    REQUEST BEG-INDEX
    IF PROMPTOK
      THEN REQUEST = END-INDEX
    IF PROMPTOK
      THEN LET PATH =3D = 1
    IF PATH =3D 0
      THEN ERROR = "Key/Index required."
    END

PROCEDURE FIND
  BEGIN
    GET CRSKSAM VIAINDEX C-INDEX = SEQUENTIAL
    END

BUILD

KSAM file structure:

    = Record:           = ;  CRSKSAM
    of = File:            = CRSKSAM
    = Organization:       INDEXED
    = Type:           &= nbsp;   KSAMXL   (ASCII)
    = Open:           &= nbsp;   CRSKSAM
    Description:
          &nb= sp;  This file contains the index number related to each
combined
          &nb= sp;  session, department, course + section key and is used = to
          &nb= sp;  retrieve course information via an index number which = is
          &nb= sp;  easier to remember and faster to use.
    Record = Size:        36 Bytes

-- Record Contents --
    = Item           &n= bsp;           &n= bsp;         = Type            = Size  Occ
Offset
    = C-INDEX           = ;            = ;       = CHARACTER          = 6
0
    = C-SESS-CRS-SEC1         &nb= sp;            = CHARACTER         15
6
    = .C-SESSION1          =             =     = CHARACTER          = 4
6
    = .C-DEPT1          &nb= sp;           &nb= sp;      = CHARACTER          = 5
10
    = .C-CRS1          &nbs= p;           &nbs= p;       = CHARACTER          = 4
15
    = .C-SEC1          &nbs= p;           &nbs= p;       = CHARACTER          = 2
19
    = C-SESS-CRS-SEC2         &nb= sp;            = CHARACTER         15
21
    = .C-SESSION2          =             =     = CHARACTER          = 4
21
    = .C-DEPT2          &nb= sp;           &nb= sp;      = CHARACTER          = 5
25
    = .C-CRS2          &nbs= p;           &nbs= p;       = CHARACTER          = 4
30
    = .C-SEC2          &nbs= p;           &nbs= p;       = CHARACTER          = 2
34

-- Index Contents --

 ** C-INDEX is a 6 byte   UNIQUE = PRIMARY  index **


    = Segment           = ;            = ;       = Type            = Size  Ord
Offset
    = C-INDEX           = ;            = ;       = CHARACTER          = 6    A
0


 ** C-SESS-CRS-SEC1 is a 15 byte  REPEATING = ALTERNATE  index **


    = Segment           = ;            = ;       = Type            = Size  Ord
Offset
    = C-SESS-CRS-SEC1         &nb= sp;            = CHARACTER         = 15    A
0


 ** C-SESS-CRS-SEC2 is a 15 byte  REPEATING = ALTERNATE  index **


    = Segment           = ;            = ;       = Type            = Size  Ord
Offset
    C-SESS-CRS-SEC2   &= nbsp;           &= nbsp;      = CHARACTER         = 15    A
0



------_=_NextPart_001_01C1523C.A578D740--