KX Community

Find answers, ask questions, and connect with our KX Community around the world.
KX Community Guidelines

Home Forums kdb+ Question about query that stuck the KDB process Re: Question about query that stuck the KDB process

  • rocuinneagain

    Member
    April 29, 2022 at 12:00 am

    Using parse helps to see what is happening.

     

    Parsing a simplified version of your query helped to show the order of execution in the parse tree:

    q)-1 .Q.s1 last value last parse "select sums(size)/sum(size) from tab"; ((/;`size);+;(sum;`size))

    The q equivalent can then be shown to have the same parse tree

    q)-1 .Q.s1 parse"size/[sums;sum size]"; ((/;`size);+;(sum;`size))