Discussions

Expand all | Collapse all

Cannot use a fast path for COUNT distinct

  • 1.  Cannot use a fast path for COUNT distinct

    Posted 12-16-2019 03:59
    Edited by Omnisci user 12-16-2019 06:59
    Hi
    this is my query :
                          select count(distinct "m543_part".reorderPoint) from "m543_part";


    i am getting error as "Cannot use a fast path for COUNT distinct"  is there any way to solve this out
    #Core
    #Immerse


  • 2.  RE: Cannot use a fast path for COUNT distinct

    Posted 12-16-2019 05:17
    Edited by Candido Dessanti 12-16-2019 05:34
    Hi,
    it's a watchdog exception, so if you disable it (setting the enable-watchdog parameter to false), the query will run. but the performance is likley to be subpar.

    probably is better to use the approx_count_distinct function. You can read about this function here

    https://docs.omnisci.com/latest/5_math.html
    as a workaround for keyless query like that you can run the count distinct with a subquery
    e.g.
    select count(reorderPoint) from (select "m543_part".reorderPoint from "m543_part" group by 1);​



  • 3.  RE: Cannot use a fast path for COUNT distinct

    Posted 12-16-2019 21:27
    Edited by Omnisci user 12-16-2019 21:28
    Hi @Candido Dessanti

    how to update mapd.conf file for setting watchdog to false i am using gpu 
    dont know where to update mapd conf file can you please help me to do this without losing any data in it​


  • 4.  RE: Cannot use a fast path for COUNT distinct

    Posted 12-16-2019 22:19
    Hi,

    Assuming you have used the defaults while running the system scripts the config files called omnisci.conf is located in the path /var/lib/omnisci

    So you have to change the file adding a line with enable-watchdog=false and then restarting the server running

    sudo service omnisci_server restart


     If you aren't able to find the file try searching it in the server running

    find / -name omnisci.conf

    Probably the count distinct will run, but not using the fast path, is likely to be not performant at best.

    Have you tried the alternatives? (approx count distinct and workaround?)


  • 5.  RE: Cannot use a fast path for COUNT distinct

    Posted 12-16-2019 22:28
    Hi,
    yes i have tried with approx count distinct its working but we need to be generic for all queries 


  • 6.  RE: Cannot use a fast path for COUNT distinct

    Posted 12-16-2019 23:33
    As a rule of thumb, a fast path for distincts cannot be applied to datatypes like float/double and timestamps, because of the size of bitmap needed.
    Which datatype are you using on the query?