• SKIP +1000 and SKIP -1000

    From Marco Boschi@21:1/5 to All on Wed Aug 4 01:42:20 2021
    Hi,
    how does the SKIP command works?
    In a LAN using DBFCDX If I Open a table of 68000 records (123 mb dbf 2 mb fpt and 11 mb cdx files) if I skip +1 or -1 it's fast. If I SKIP +1000 and SKIP -1000 it takes 2 seconds. If I SKIP 9000 or SKIP -9000 it takes 20 seconds.
    How does the SKIP command works?

    Many thanks

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From dlzc@21:1/5 to Marco Boschi on Wed Aug 4 07:52:15 2021
    Dear Marco Boschi:

    On Wednesday, August 4, 2021 at 1:42:22 AM UTC-7, Marco Boschi wrote:
    Hi,
    In a LAN using DBFCDX If I Open a table of 68000 records
    (123 mb dbf 2 mb fpt and 11 mb cdx files) if I skip +1 or -1
    it's fast.

    It is finding its position in the index, then moving up or down one record.

    If I SKIP +1000 and SKIP -1000 it takes 2 seconds. If I SKIP 9000 or
    SKIP -9000 it takes 20 seconds.
    How does the SKIP command works?

    I'd think it is getting "confused" by the indexes you have open, and filters you have in effect. What happens if you "SET ORDER TO" and "SET FILTER TO" with no argument, so that it can just use the record pointer? So it is likely moving record-by-
    record, through the index, in current index order. Pumping the data off the server, to your computer to perform the logic, and repeating 1000 or 9000 times.

    Here are some options: https://www.itlnet.net/programming/program/Reference/c53g01c/ngf31ef.html
    dbgoto(recno()-1000) ... should be pretty fast.

    David A. Smith

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Claudio H@21:1/5 to All on Wed Aug 4 09:58:24 2021
    David

    He wants to SKIP records folowing the order set by the active index and honoring filters, not moving the pointer in the physical order of the records.
    Regards

    Claudio H

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Marco Boschi@21:1/5 to All on Thu Aug 5 00:38:00 2021
    Il giorno mercoledì 4 agosto 2021 alle 18:58:25 UTC+2 Claudio H ha scritto:
    David

    He wants to SKIP records folowing the order set by the active index and honoring filters, not moving the pointer in the physical order of the records.
    Regards

    Claudio H
    Many Thanks to all!
    in my program I never skip +1000 I wrote some test to debug some slowness of my programs
    dbgoto(recno()-1000) ... should be pretty fast.
    I have verifiedi this is very fast
    it would be nice if you could do something like that
    nCurKey := OrdKeyNo()
    SkipKey( nCurKey + 1000)

    King regards
    marco

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From dlzc@21:1/5 to Marco Boschi on Thu Aug 5 12:38:58 2021
    Dear Marco Boschi:

    On Thursday, August 5, 2021 at 12:38:01 AM UTC-7, Marco Boschi wrote:
    ...
    it would be nice if you could do something like that
    nCurKey := OrdKeyNo()
    SkipKey( nCurKey + 1000)

    https://www.itlnet.net/programming/program/Reference/c53g01c/ng2a6f6.html
    ... sort of indicates that DBOI_POSITION could have been read and changed, to move to that position in the current index. But it says it was never implemented by RDDs under Clipper 5.3. I wonder if it ever was in (x)Harbour? Might trying reading it,
    decrementing it, and see if the record number changes. Might need to "flush the buffers" somehow, of course.

    David A. Smith

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Marco Boschi@21:1/5 to All on Fri Aug 6 01:33:20 2021
    Many thanks David

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)