<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>A month later...</p>
    <p>Maryse found a (recommanded) solution for the aqspent.pl crashes:</p>
    <p><font size="-1"><tt>-    aqorders.biblionumber,
          aqorders.basketno, aqorders.ordernumber,</tt><tt><br>
        </tt><tt>-    quantity-quantityreceived AS tleft,</tt><tt><br>
        </tt><tt>-    budgetdate, entrydate,</tt><tt><br>
        </tt><tt>-    aqbasket.booksellerid,</tt><tt><br>
        </tt><tt>+    MAX(aqorders.biblionumber) AS biblionumber,
          MAX(aqorders.basketno) AS basketno, aqorders.ordernumber,</tt><tt><br>
        </tt><tt>+    MAX(quantity)-MAX(quantityreceived) AS tleft,</tt><tt><br>
        </tt><tt>+    MAX(budgetdate) AS budgetdate, MAX(entrydate) AS
          entrydate,</tt><tt><br>
        </tt><tt>+    MAX(aqbasket.booksellerid) AS booksellerid,</tt><tt><br>
        </tt><tt>     GROUP_CONCAT(DISTINCT itype SEPARATOR '|') as
          itypes,</tt><tt><br>
        </tt><tt>-    title,</tt><tt><br>
        </tt><tt>-    aqorders.invoiceid,</tt><tt><br>
        </tt><tt>-    aqinvoices.invoicenumber,</tt><tt><br>
        </tt><tt>-    quantityreceived,</tt><tt><br>
        </tt><tt>-    unitprice_tax_included,</tt><tt><br>
        </tt><tt>-    datereceived,</tt><tt><br>
        </tt><tt>-    aqbooksellers.name as vendorname</tt><tt><br>
        </tt><tt>+    MAX(title) AS title,</tt><tt><br>
        </tt><tt>+    MAX(aqorders.invoiceid) AS invoiceid,</tt><tt><br>
        </tt><tt>+    MAX(aqinvoices.invoicenumber) AS invoicenumber,</tt><tt><br>
        </tt><tt>+    MAX(quantityreceived) AS quantityreceived,</tt><tt><br>
        </tt><tt>+    MAX(unitprice_tax_included) AS
          unitprice_tax_included,</tt><tt><br>
        </tt><tt>+    MAX(datereceived) AS datereceived,</tt><tt><br>
        </tt><tt>+    MAX(aqbooksellers.name) as vendorname</tt><tt><br>
        </tt></font></p>
    <p>We'll hack that in all our distributions.  But I'd really like to
      have an official distributed solution to the problem.  To me, it's
      not that much uglier than the fix adding all the column to avoid
      the problem with ONLY_FULL_GROUP_BY.</p>
    <p>What's your take on it?</p>
    <p>Regards,<br>
    </p>
    <div class="moz-signature">
      <style type="text/css">
.moz-signature {
 color: #FFFFFF;
}
.sig_inlibro {
 padding-top : 2px;
 color: #888888;
 font-family : "Trebuchet MS", verdana;
 font-size: 90%;
}
.sig_content {
 border-top: 2px solid #DDDDDD;
 border-bottom: 2px solid #BFD13D;
 background-color : #F6F6F6;
 padding-left:10px;
}
.sig_inlibro a:visited, .sig_inlibro a:hover, .sig_inlibro a:link {
 text-decoration: none;
 color: #005B85;
}
.nom {
 color: #005B85;
 font-weight : bold;
}
.inlibro, .in {
 color: #BFD13D;
}
.libro {
 color: #005B85;
}
.in, .libro {
 font-size : 120%;
}
.desc {
    margin-bottom: 0;
    padding-bottom: 5px;
}
.small {
 font-size: 80%;
}
.tagline {
 color : #00BCE4;
}
.sig_footer {
 padding-left : 10px;
 background-color : #EEEFEA;
}
</style>
      <div class="sig_inlibro">
        <div class="sig_content"> <span class="nom">Philippe Blouin,</span><br>
          <span class="tagline small">Directeur de la technologie</span><br>
          <p class="desc small"> Tél.  : (833) 465-4276, poste 230<br>
            <!--
   Tél.  : (888) 604-2627<br/>
--> <a href="mailto:philippe.blouin@inLibro.com">philippe.blouin@inLibro.com</a>
          </p>
        </div>
        <div class="sig_footer"> <span class="in">in</span><span
            class="libro">Libro</span> <span class="tagline small">|
            pour esprit libre |</span> <a class="small"
            href="http://www.inLibro.com">www.inLibro.com</a> </div>
      </div>
    </div>
    <div class="moz-cite-prefix">On 2019-12-13 11:25 a.m., Philippe
      Blouin wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:2744e3d3-84f1-7f82-3bfd-822ecf437c5e@inlibro.com">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <p>minuscule:</p>
      <ul>
        <li>2000 biblio, 12000 items</li>
        <li>8 aqbudgets, 200 invoices, 25 booksellers, 60 baskets, 240
          orders.</li>
      </ul>
      <p>That makes little sense...<br>
      </p>
      <div class="moz-signature">
        <style type="text/css">
.moz-signature {
 color: #FFFFFF;
}
.sig_inlibro {
 padding-top : 2px;
 color: #888888;
 font-family : "Trebuchet MS", verdana;
 font-size: 90%;
}
.sig_content {
 border-top: 2px solid #DDDDDD;
 border-bottom: 2px solid #BFD13D;
 background-color : #F6F6F6;
 padding-left:10px;
}
.sig_inlibro a:visited, .sig_inlibro a:hover, .sig_inlibro a:link {
 text-decoration: none;
 color: #005B85;
}
.nom {
 color: #005B85;
 font-weight : bold;
}
.inlibro, .in {
 color: #BFD13D;
}
.libro {
 color: #005B85;
}
.in, .libro {
 font-size : 120%;
}
.desc {
    margin-bottom: 0;
    padding-bottom: 5px;
}
.small {
 font-size: 80%;
}
.tagline {
 color : #00BCE4;
}
.sig_footer {
 padding-left : 10px;
 background-color : #EEEFEA;
}
</style>
        <div class="sig_inlibro">
          <div class="sig_content"> <span class="nom">Philippe Blouin,</span><br>
            <span class="tagline small">Directeur de la technologie</span><br>
            <p class="desc small"> Tél.  : (833) 465-4276, poste 230<br>
              <!--
   Tél.  : (888) 604-2627<br/>
--> <a href="mailto:philippe.blouin@inLibro.com" moz-do-not-send="true">philippe.blouin@inLibro.com</a>
            </p>
          </div>
          <div class="sig_footer"> <span class="in">in</span><span
              class="libro">Libro</span> <span class="tagline small">|
              pour esprit libre |</span> <a class="small"
              href="http://www.inLibro.com" moz-do-not-send="true">www.inLibro.com</a>
          </div>
        </div>
      </div>
      <div class="moz-cite-prefix">On 2019-12-13 9:49 a.m., Jonathan
        Druart wrote:<br>
      </div>
      <blockquote type="cite"
cite="mid:CAJzKNY7yUyy9w-v4FJwVHvYxKy7Q9SO9WXoorLyy7rRVE05aMA@mail.gmail.com">
        <pre class="moz-quote-pre" wrap="">How big is your tables?
As you can see SQL query is really ugly, and can be good to split it anyway...

Le ven. 13 déc. 2019 à 15:26, Philippe Blouin
<a class="moz-txt-link-rfc2396E" href="mailto:philippe.blouin@inlibro.com" moz-do-not-send="true"><philippe.blouin@inlibro.com></a> a écrit :
</pre>
        <blockquote type="cite">
          <pre class="moz-quote-pre" wrap="">Thanks,

Ok, I've never seen the "$field is not in group by" error.  Interesting.

I've followed the bread crumbs: 21622 -> 20182 -> 21723 -> 22260... read it all.  It's "damned if you do, damned if you don't".

ONLY_FULL_GROUP_BY mode is the SQL Standard, I don't think it would be wise to stray from that.  (I can do it locally, but I don't think Koha should, philosophically)

But my client can't click on spent.pl.  And no memory setting seems to fix it.  So what's my solution?  Could the query be reworked in two steps?  This is not a screen where 0.2s will make a difference in the user experience.

Suggestions welcomed.

Philippe Blouin,
Directeur de la technologie

Tél.  : (833) 465-4276, poste 230
<a class="moz-txt-link-abbreviated" href="mailto:philippe.blouin@inLibro.com" moz-do-not-send="true">philippe.blouin@inLibro.com</a>

inLibro | pour esprit libre | <a class="moz-txt-link-abbreviated" href="http://www.inLibro.com" moz-do-not-send="true">www.inLibro.com</a>
On 2019-12-13 4:33 a.m., Jonathan Druart wrote:

Hi Philippe,

See bug 21622.
It is necessary to not explode with "$field is not in group by" (when
sql_mode has ONLY_FULL_GROUP_BY)
However we may need to discuss the need of this flag if it brings us
performance issues.

Cheers,
Jonathan

Le jeu. 12 déc. 2019 à 23:23, Philippe Blouin
<a class="moz-txt-link-rfc2396E" href="mailto:philippe.blouin@inlibro.com" moz-do-not-send="true"><philippe.blouin@inlibro.com></a> a écrit :

Good morning Koha,

Newbie question: why do we have 16 fields in GROUP BYs ?  Are they really all necessary to eliminate duplicate lines in budgets?  Genuine question.

When in acqui-home.pl, clicking certain entries linking to spent.pl just crashes with the error listed in the mail's object: Out of memory.  Although I hate that solution, I went with it, increased sort_buffer_size 64x fold (I'm a generous guy).  Still not enough.

Removing most lines in GROUP BY of spent.pl solves it all, of course.

--
Philippe Blouin,
Directeur de la technologie

Tél.  : (833) 465-4276, poste 230
<a class="moz-txt-link-abbreviated" href="mailto:philippe.blouin@inLibro.com" moz-do-not-send="true">philippe.blouin@inLibro.com</a>

inLibro | pour esprit libre | <a class="moz-txt-link-abbreviated" href="http://www.inLibro.com" moz-do-not-send="true">www.inLibro.com</a>
_______________________________________________
Koha-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Koha-devel@lists.koha-community.org" moz-do-not-send="true">Koha-devel@lists.koha-community.org</a>
<a class="moz-txt-link-freetext" href="https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel" moz-do-not-send="true">https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel</a>
website : <a class="moz-txt-link-freetext" href="http://www.koha-community.org/" moz-do-not-send="true">http://www.koha-community.org/</a>
git : <a class="moz-txt-link-freetext" href="http://git.koha-community.org/" moz-do-not-send="true">http://git.koha-community.org/</a>
bugs : <a class="moz-txt-link-freetext" href="http://bugs.koha-community.org/" moz-do-not-send="true">http://bugs.koha-community.org/</a>
</pre>
        </blockquote>
      </blockquote>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Koha-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Koha-devel@lists.koha-community.org">Koha-devel@lists.koha-community.org</a>
<a class="moz-txt-link-freetext" href="https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel">https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel</a>
website : <a class="moz-txt-link-freetext" href="http://www.koha-community.org/">http://www.koha-community.org/</a>
git : <a class="moz-txt-link-freetext" href="http://git.koha-community.org/">http://git.koha-community.org/</a>
bugs : <a class="moz-txt-link-freetext" href="http://bugs.koha-community.org/">http://bugs.koha-community.org/</a>
</pre>
    </blockquote>
  </body>
</html>