Grouped attribute on lists - Kdb+ / qStudio

Home Forums Kdb+ / qStudio Grouped attribute on lists

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #111281

    ryb
    Member

    Hi all,

    I’m curious what list verbs take advantage of the Grouped attribute. Running `group` on a list with the attribute is extremely fast which is cool but, for instance, `where` on a list is the same speed though I’d expect a speedup there too.

    `
    q)l:100000?-1000?`3
    q)l
    `idb`mkh`cki`efd`beg`apd`goa`neo`ldk`kle`leh`ngj`mai`obc`kpd`mid`epl`efk`ofp`..
    q)m:`g#l
    q)\t do[100; group l]
    153
    q)\t do[100; group m]
    1
    q)\t do[1000; count where m = `beg]
    374
    q)\t do[1000; count (group m) `beg]
    7
    `

    #111303

    You’ll find the attributes are used much more often during select queries:


    q)n:200100
    q)t:([] a:`g#n?1000; b:n?1000)
    q)\t:10000 t[`a]=1
    4650
    q)\t:10000 select from t where a=1
    21
    q)\t:10000 select from t where b=1
    5634

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.