• bBrowser row count for specific condition

    From Grzegorz R.@21:1/5 to All on Thu May 6 13:54:11 2021
    Hello all,
    I have child DBserver filtered with SetSelectiveRelation and bound to bBrowser. I would like to quicklu get count of all recs where one column (field) is not empty. Like CheckColumn:CheckedCount bot not logical column/field - in this case it's date field.
    I could do it with while-skip loop (either at DBserver or bBrowser) but I'm afraid it will be slow and I think that lowlevel :CheckedCount is much faster and does not require moving bound server.
    I have created virtual column containing logical value (empty/not empty) but Virtualcolumn does not have :CheckedCount method even if contains logical values.
    I could also add new field to database with logical flag empty/notempty and bind CheckColumn but it just would in some way "duplicate" info that is already in DB (although in another form).
    Is there any way to count rows that meet a certain coniditon in specific column without moving dbserver pointer?
    Kind regards
    Gregory

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From dlzc@21:1/5 to ramo...@gmail.com on Fri May 7 06:44:42 2021
    Dear ramo...:

    On Thursday, May 6, 2021 at 1:54:12 PM UTC-7, ramo...@gmail.com wrote:
    ...
    Is there any way to count rows that meet a certain coniditon
    in specific column without moving dbserver pointer?

    Can you create an index on that date field, set ".not. empty()" as one of the conditions, and get a count of indexed items? If it is a "permanent" index, then you should have less performance penalty.

    I don't do VO, so I cannot help beyond that. Something like: https://harbour.github.io/doc/rddads.html#adskeycount

    David A. Smith

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Grzegorz R.@21:1/5 to All on Mon May 10 05:39:54 2021
    piątek, 7 maja 2021 o 15:44:43 UTC+2 dlzc napisał(a):
    Dear ramo...:

    On Thursday, May 6, 2021 at 1:54:12 PM UTC-7, ramo...@gmail.com wrote:
    ...
    Is there any way to count rows that meet a certain coniditon
    in specific column without moving dbserver pointer?
    Can you create an index on that date field, set ".not. empty()" as one of the conditions, and get a count of indexed items? If it is a "permanent" index, then you should have less performance penalty.

    I don't do VO, so I cannot help beyond that. Something like: https://harbour.github.io/doc/rddads.html#adskeycount

    David A. Smith

    Hello David

    thank You for suggestion but a) I can make index FOR (condition) but it does not tell how many elements have been indexed (at least I do not know how to get it) and b) I do not use Harbour ADS so do not have any advanced functions&methods.

    Anyway - thank You
    Gregory

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From dlzc@21:1/5 to ramo...@gmail.com on Mon May 10 07:08:44 2021
    Dear ramo...:

    On Monday, May 10, 2021 at 5:39:55 AM UTC-7, ramo...@gmail.com wrote:
    piątek, 7 maja 2021 o 15:44:43 UTC+2 dlzc napisał(a):
    On Thursday, May 6, 2021 at 1:54:12 PM UTC-7, ramo...@gmail.com wrote:
    ...
    Is there any way to count rows that meet a certain coniditon
    in specific column without moving dbserver pointer?
    Can you create an index on that date field, set ".not. empty()"
    as one of the conditions, and get a count of indexed items?
    If it is a "permanent" index, then you should have less
    performance penalty.

    I don't do VO, so I cannot help beyond that. Something like: https://harbour.github.io/doc/rddads.html#adskeycount

    thank You for suggestion but a) I can make index FOR
    (condition) but it does not tell how many elements have
    been indexed (at least I do not know how to get it)

    That was my hope, that VO had tools similar to those for ADS (not a part of (x)Harbour... a sort of SQL alternative).

    The type of index used, the number of keys is stored in the index file: https://www.clicketyclick.dk/databases/xbase/format/cdx.html#CDX_STRUCT
    ... not saying you use CDX files.

    and b) I do not use Harbour ADS so do not have any
    advanced functions&methods.

    I was not trying to convert you. Just trying to get you 'out of the corner'. I hope someone chimes in with a way to accomplish your need. I'll shut up now.

    David A. Smith

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