<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style>
<!--
@font-face
        {font-family:"MS Mincho"}
@font-face
        {font-family:"MS Mincho"}
@font-face
        {font-family:Calibri}
@font-face
        {font-family:Tahoma}
@font-face
        {font-family:"\@MS Mincho"}
@font-face
        {font-family:Consolas}
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif"}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif"}
span.PlainTextChar
        {font-family:Consolas}
p.msochpdefault, li.msochpdefault, div.msochpdefault
        {margin-right:0cm;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Calibri","sans-serif"}
span.plaintextchar0
        {font-family:"Calibri","sans-serif"}
span.EmailStyle21
        {font-family:"Calibri","sans-serif";
        color:#1F497D}
.MsoChpDefault
        {font-size:10.0pt;
        font-family:"Calibri","sans-serif"}
@page WordSection1
        {margin:72.0pt 72.0pt 72.0pt 72.0pt}
div.WordSection1
        {}
-->
</style>
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">Further investigation shows that the aggregate works as expected when running on a single threaded server.</span></p>
<p class="MsoNormal"><span style="color:#1F497D">Seems to me that I’m missing something in a multi-threaded server that I can use to link the ‘g’ entries to their actual data OIDs i.e. the links should be</span></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="color:#1F497D">‘e’           ->            ‘g’           ->            ?              ->            ‘b’</span></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="color:#1F497D">Where ‘?’ is a BAT with the subgroups OIDs to data OIDs
</span></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="color:#1F497D">Is there any other MAL functions that I can use to get access to this BAT?</span></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="color:#1F497D">Regards,</span></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="color:#1F497D">Scott</span></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span></p>
<div>
<div style="border:none; border-top:solid #B5C4DF 1.0pt; padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt; font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt; font-family:"Tahoma","sans-serif""> users-list [mailto:users-list-bounces+scott.mathieson=pb.com@monetdb.org]
<b>On Behalf Of </b>Scott Mathieson<br>
<b>Sent:</b> 05 July 2013 14:00<br>
<b>To:</b> Communication channel for MonetDB users<br>
<b>Subject:</b> RE: aggregate function in MAL</span></p>
</div>
</div>
<p class="MsoNormal"> </p>
<div>
<p class="MsoPlainText">Hi Stefan,</p>
<p class="MsoPlainText"> </p>
<p class="MsoPlainText">Thanks for your help, however I'm still seeing the same issue with your suggested changes - the 'g'  BAT only contains 4 rows (2 groups x 2 threads) and the 'b' BAT contains the 249k rows which is the size of the data table - I was assuming
 that either the 'g' and 'b' BATs are the same size or that there is some form of indexing of 'g' to 'b'.</p>
<p class="MsoPlainText"> </p>
<p class="MsoPlainText">The aggregation I'm testing is this:</p>
<p class="MsoPlainText"> </p>
<p class="MsoPlainText"><span style="font-family:"Courier New"">select "Gender", bin_samp("CustomerAge"), count(*) from "Customers" group by "Gender";</span></p>
<p class="MsoPlainText"> </p>
<p class="MsoPlainText">and the result I get is:</p>
<p class="MsoPlainText"> </p>
<p class="MsoPlainText"><span style="font-family:"Courier New"">+--------+----------+--------+</span></p>
<p class="MsoPlainText"><span style="font-family:"Courier New"">| Gender | L1       | L2     |</span></p>
<p class="MsoPlainText"><span style="font-family:"Courier New"">+========+==========+========+</span></p>
<p class="MsoPlainText"><span style="font-family:"Courier New"">| Female | 12||12|| | 106024 |</span></p>
<p class="MsoPlainText"><span style="font-family:"Courier New"">| Male   | 12||50|| | 143703 |</span></p>
<p class="MsoPlainText"><span style="font-family:"Courier New"">+--------+----------+--------+</span></p>
<p class="MsoPlainText"> </p>
<p class="MsoPlainText">I would have expected the bin_samp aggregate to have returned strings of 1000 values pipe delimited per Gender value rather than only 2 values – I’m assuming something is wrong in the mapping of ‘g’ to ‘b’ entries</p>
<p class="MsoPlainText"> </p>
<p class="MsoPlainText">The ‘g’ bat look like this:</p>
<p class="MsoPlainText"> </p>
<p class="MsoPlainText">#-----------------#</p>
<p class="MsoPlainText"># h     t         # name</p>
<p class="MsoPlainText"># void  oid       # type</p>
<p class="MsoPlainText">#-----------------#</p>
<p class="MsoPlainText">[ 0@0,    0@0     ]</p>
<p class="MsoPlainText">[ 1@0,    1@0     ]</p>
<p class="MsoPlainText">[ 2@0,    0@0     ]</p>
<p class="MsoPlainText">[ 3@0,    1@0     ]</p>
<p class="MsoPlainText"> </p>
<p class="MsoPlainText">And the ‘b’ bat is:</p>
<p class="MsoPlainText"> </p>
<p class="MsoPlainText">#-------------------------#</p>
<p class="MsoPlainText"># h             t         # name</p>
<p class="MsoPlainText"># void          int       # type</p>
<p class="MsoPlainText">#-------------------------#</p>
<p class="MsoPlainText">[ 0@0,            12      ]</p>
<p class="MsoPlainText">[ 1@0,            12      ]</p>
<p class="MsoPlainText">[ 2@0,            12      ]</p>
<p class="MsoPlainText">[ 3@0,            50      ]</p>
<p class="MsoPlainText">[ 4@0,            56      ]</p>
<p class="MsoPlainText">[ 5@0,            12      ]</p>
<p class="MsoPlainText">[ 6@0,            12      ]</p>
<p class="MsoPlainText">[ 7@0,            34      ]</p>
<p class="MsoPlainText">[ 8@0,            12      ]</p>
<p class="MsoPlainText">[ 9@0,            12      ]</p>
<p class="MsoPlainText">… continues to @249727@0</p>
<p class="MsoPlainText"> </p>
<p class="MsoPlainText"> </p>
<p class="MsoPlainText">Kind reagards,</p>
<p class="MsoPlainText"> </p>
<p class="MsoPlainText"> </p>
<p class="MsoPlainText">Scott Mathieson</p>
<p class="MsoPlainText"> </p>
</div>
<p class="MsoNormal"><span style="font-size:12.0pt; font-family:"Times New Roman","serif""> </span></p>
<div class="MsoNormal" align="center" style="text-align:center"><span style="font-size:12.0pt; font-family:"Times New Roman","serif"">
<hr size="2" width="100%" align="center">
</span></div>
<p class="MsoNormal"><span style="font-size:12.0pt; font-family:"Times New Roman","serif""> </span></p>
</div>
<br>
<hr>
<font face="Arial" color="Black" size="2"><br>
</font>
</body>
</html>