<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Hi Andi...<br>
    <br>
    <blockquote
cite="mid:CAD+a8MjYNu-=Rvbbw-8gMOm9EDwnpKKPhSV-SgMeXMRQyuxxyQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote"><br>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px
              0.8ex;border-left:1px solid
              rgb(204,204,204);padding-left:1ex"><a
                moz-do-not-send="true"
                href="http://vz/middleware.php/capabilities/database.json"
                target="_blank">http://vz/middleware.php/capabilities/database.json</a><br>
              <br>
              liefert mir:<br>
              <br>
              {"version":"0.3","capabilities":{"database":{"data_rows":6420892,"data_size":592134144,"aggregation_enabled":1,"aggregation_rows":58082,"aggregation_ratio":110.549}}}<br>
              <br>
              ... also ist das doch offenbar richtig aktiviert</blockquote>
            <div><br>
            </div>
            <div>Erstmal sind Daten drin. Ob die für die Kanäle drin
              sind die bei Dir "langsam" sind sieht man daran nicht. <br>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    <!--?xml version="1.0" encoding="UTF-8"?-->
    <pre><code><span class="sql1-reservedword">select *, from_unixtime(timestamp/1000) from aggregate order by channel_id, timestamp </span><span class="sql1-reservedword">


</span></code></pre>
    <title>Untitled</title>
    <meta http-equiv="Content-Type" content="text/html;
      charset=ISO-8859-1">
    <meta name="generator" content="SynEdit HTML exporter">
    <style type="text/css">
<!--
body { color: #000000; background-color: #FFFFFF; }
.sql1-comment { color: #808080; font-style: italic; }
.sql1-conditionalcomment { color: #808080; font-style: italic; }
.sql1-datatype { color: #800000; font-weight: bold; }
.sql1-defaultpackages { font-weight: bold; }
.sql1-delimitedidentifier { color: #808000; }
.sql1-exception { font-style: italic; }
.sql1-function { color: #000080; font-weight: bold; }
.sql1-identifier { color: #808000; }
.sql1-number { color: #800080; }
.sql1-plsql-reservedword { font-weight: bold; }
.sql1-reservedword { color: #0000FF; font-weight: bold; }
.sql1-space { }
.sql1-sqlplus-command { font-weight: bold; }
.sql1-string { color: #008000; }
.sql1-symbol { color: #0000FF; }
.sql1-tablename { color: #FF00FF; }
.sql1-variable { color: #800080; }
--> </style>zeigt mir, dass für *alle* channels stündlich ein Wert
    vorhanden ist. Zudem gibts je einen Tageswert (type=3 nehme ich an).<br>
    <br>
    <blockquote
cite="mid:CAD+a8MjYNu-=Rvbbw-8gMOm9EDwnpKKPhSV-SgMeXMRQyuxxyQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">
            <div>
              <div class="gmail_extra">
                <div class="gmail_quote">
                  <div> </div>
                  <blockquote class="gmail_quote" style="margin:0px 0px
                    0px 0.8ex;border-left:1px solid
                    rgb(204,204,204);padding-left:1ex">
                    <div bgcolor="#FFFFFF">
                      <div>Jedenfalls steht in volkszaehler.conf.php was
                        von "administration credentials" - ich gehe mal
                        davon aus, dass ich für den user root mein
                        login-PW eintrage.<br>
                      </div>
                    </div>
                  </blockquote>
                  <div><br>
                  </div>
                  <div>Ganz sicher nicht?! Da kommt ein DB-User mit
                    CREATE/DROP Privilegien rein falls Dein normaler
                    DB-User die nicht hat.<br>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    Hm, ich hab den Standarduser nicht geändert, also lass ich das
    default-PW drin, ok. Diese Geschichte ist mir auch erst gestern ganz
    spät nachts aufgefallen, da hab ich aggregate-Tabelle schon längst
    erzeugt. Habs gerade nochmal getestet, hast recht: mit meinem
    root-shell-PW gibts nen "access denied for user root..." Fehler.
    Klappt jetzt wieder:<br>
    <br>
    pi@BauratPi ~ $ php
    /var/www/volkszaehler.org/misc/tools/aggregate.php -m full -l day -l
    hour run<br>
    Performing 'full' aggregation on 'day' level.<br>
    Updated 3999 rows.<br>
    Performing 'full' aggregation on 'hour' level.<br>
    Updated 83685 rows.<br>
    <br>
    <blockquote
cite="mid:CAD+a8MjYNu-=Rvbbw-8gMOm9EDwnpKKPhSV-SgMeXMRQyuxxyQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">
            <div>
              <div class="gmail_extra">
                <div class="gmail_quote">
                  <div> <br>
                  </div>
                  <blockquote class="gmail_quote" style="margin:0px 0px
                    0px 0.8ex;border-left:1px solid
                    rgb(204,204,204);padding-left:1ex">
                    <div bgcolor="#FFFFFF">
                      <div> Die Timezone ("Europe/Berlin") ist
                        rauskommentiert - soll das so sein?<br>
                      </div>
                    </div>
                  </blockquote>
                  <div><br>
                  </div>
                  <div>Eher nicht. <br>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    Ok, also Kommmentare raus. Done.<br>
    <br>
    <blockquote
cite="mid:CAD+a8MjYNu-=Rvbbw-8gMOm9EDwnpKKPhSV-SgMeXMRQyuxxyQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">
            <div>
              <div class="gmail_extra">
                <div class="gmail_quote">
                  <div><br>
                  </div>
                  <blockquote class="gmail_quote" style="margin:0px 0px
                    0px 0.8ex;border-left:1px solid
                    rgb(204,204,204);padding-left:1ex">
                    <div bgcolor="#FFFFFF">
                      <div> <br>
                        Tja und dann kommt also noch als letzte Zeile <br>
                        $config['aggregation']=true;<br>
                        mit rein. Speichern, aber selbst nach reboot
                        kann ich keine Beschleunigung erkennen.<br>
                      </div>
                    </div>
                  </blockquote>
                  <div><br>
                  </div>
                  <div>Reboot ist nicht nötig. Woran machst Du "keine
                    Beschleunigung" das fest? Bestimmte Abfrage? Nutzung
                    des Frontends?<br>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    Ja, Nutzung des Frontends. Bei mir dauert nach wie vor eine
    Tagesabfrage ca. 10 Sekunden, für einen Monat ca. 80 Sekunden, da
    hat sich gar nichts geändert (Zeitangaben bei Ansicht mit allen 19
    Channels).<br>
    <br>
    <blockquote
cite="mid:CAD+a8MjYNu-=Rvbbw-8gMOm9EDwnpKKPhSV-SgMeXMRQyuxxyQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">
            <div>
              <div class="gmail_extra">
                <div class="gmail_quote">
                  <div> <br>
                  </div>
                  <blockquote class="gmail_quote" style="margin:0px 0px
                    0px 0.8ex;border-left:1px solid
                    rgb(204,204,204);padding-left:1ex">
                    <div bgcolor="#FFFFFF">
                      <div> Die aggregate-Tabellen wurden erzeugt und
                        sind befüllt, hat bei 500MB data doch ganz schön
                        gedauert.<br>
                      </div>
                    </div>
                  </blockquote>
                  <div><br>
                  </div>
                  <div>Macht nix. Für Deltabefüllung gibts ja dann den
                    entsprechenden  Modus womit's auch fix geht.<br>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    Klar, kein Thema. Nur hab ich mich jetzt auf Schmidts Katze gefreut,
    aber die mag nicht ;)<br>
    <blockquote
cite="mid:CAD+a8MjYNu-=Rvbbw-8gMOm9EDwnpKKPhSV-SgMeXMRQyuxxyQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">
            <div>
              <div class="gmail_extra">
                <div class="gmail_quote">
                  <blockquote class="gmail_quote" style="margin:0px 0px
                    0px 0.8ex;border-left:1px solid
                    rgb(204,204,204);padding-left:1ex">
                    <div bgcolor="#FFFFFF">
                      <div> <br>
                        Woran könnte es liegen, dass die
                        Performanceoptimierungen bei mir nicht greifen?<br>
                      </div>
                    </div>
                  </blockquote>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <blockquote
cite="mid:CAD+a8MjYNu-=Rvbbw-8gMOm9EDwnpKKPhSV-SgMeXMRQyuxxyQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">
            <div>
              <div class="gmail_extra">
                <div class="gmail_quote"><br>
                  <div>S.o.<br>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    ...hmmmm.... leider wohl eher nicht. Menno, ich will aber die Katze
    rennen sehen... wie kann ich dem Fehler auf die Schliche kommen?<br>
    <br>
    Bin jetzt echt am Grübeln - vielleicht läuft die Optimierung ja doch
    schon? hmmm... ahhh.. moment, ich schau einfach mal ins mysql.log.
    Tatsächlich: da wird fleissig auf die aggregate-Tabelle zugegriffen:<br>
    140109 20:37:15 70465 Connect   vz@localhost on volkszaehler<br>
                    70465 Query     SELECT e0_.id AS id0, e0_.uuid AS
    uuid1, e0_.type AS type2, p1_.id AS id3, p1_.pkey AS pkey4,
    p1_.value AS value5, e0_.class AS class6, p1_.entity_id AS
    entity_id7 FROM entities e0_ LEFT JOIN properties p1_ ON e0_.id =
    p1_.entity_id WHERE (e0_.uuid =
    '9a7ed6c0-f2dc-11e2-b13e-b9abb50897a8') AND e0_.class IN ('channel',
    'aggregator') ORDER BY p1_.pkey ASC<br>
                    70465 Query     SELECT MIN(timestamp) FROM (SELECT
    timestamp FROM data WHERE channel_id='15' AND
    timestamp<'1389209549459' ORDER BY timestamp DESC LIMIT 2) t<br>
                    70465 Query     SELECT MAX(timestamp) FROM (SELECT
    timestamp FROM data WHERE channel_id='15' AND
    timestamp>'1389295949459' ORDER BY timestamp ASC LIMIT 2) t<br>
                    70465 Query     SELECT aggregate.type,
    COUNT(aggregate.id) AS count FROM aggregate INNER JOIN entities ON
    aggregate.channel_id = entities.id WHERE uuid =
    '9a7ed6c0-f2dc-11e2-b13e-b9abb50897a8' GROUP BY type HAVING count
    > 0 ORDER BY type DESC<br>
                    70465 Query     SELECT
    UNIX_TIMESTAMP(FROM_UNIXTIME(MIN(timestamp) / 1000, "%Y-%m-%d")) *
    1000 FROM aggregate WHERE channel_id='15' AND type='3' AND
    timestamp>='1388227905662'<br>
                    70465 Query     SELECT
    UNIX_TIMESTAMP(DATE_ADD(FROM_UNIXTIME(MAX(timestamp) / 1000,
    "%Y-%m-%d"), INTERVAL 1 day)) * 1000 FROM aggregate WHERE
    channel_id='15' AND type='3' AND timestamp<'1389296017384'<br>
                    70465 Query     SELECT SUM(count) FROM (SELECT
    COUNT(1) AS count FROM data WHERE channel_id = '15' AND ( timestamp
    >= '1388227905662' AND timestamp < '1388185200000' OR
    timestamp >= '1388271600000' AND timestamp <= '1389296017384')
    UNION SELECT SUM(count) AS count FROM aggregate WHERE channel_id =
    '15' AND type = '3' AND timestamp >= '1388185200000' AND
    timestamp < '1388271600000') AS agg<br>
    <br>
    <br>
    ...also alles richtig und muss damit leben, dass Schmidts Katze bei
    mir nicht mag...?<br>
    <br>
    Danke...!<br>
    LG Heiko<br>
    <br>
    <blockquote
cite="mid:CAD+a8MjYNu-=Rvbbw-8gMOm9EDwnpKKPhSV-SgMeXMRQyuxxyQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">
            <div>
              <div class="gmail_extra">
                <div class="gmail_quote">
                  <blockquote class="gmail_quote" style="margin:0px 0px
                    0px 0.8ex;border-left:1px solid
                    rgb(204,204,204);padding-left:1ex">
                    <div bgcolor="#FFFFFF">
                      <div> <br>
                        Am 27.12.2013 18:22, schrieb Andreas Goetz:<br>
                      </div>
                      <div class="im">
                        <blockquote type="cite">
                          <div dir="ltr">
                            <div class="gmail_extra">
                              <div class="gmail_quote">2013/12/27 W3ll
                                Schmidt <span dir="ltr"><<a
                                    moz-do-not-send="true"
                                    href="mailto:w3llschmidt@gmail.com"
                                    target="_blank">w3llschmidt@gmail.com</a>></span><br>
                                <blockquote class="gmail_quote"
                                  style="margin:0px 0px 0px
                                  0.8ex;border-left:1px solid
                                  rgb(204,204,204);padding-left:1ex">
                                  <div dir="ltr">
                                    <div>Super Arbeit, läuft aum Raspi
                                      wie 'Schmidts Katze' !!!<br>
                                    </div>
                                  </div>
                                </blockquote>
                              </div>
                              <br>
                            </div>
                            <div class="gmail_extra">Das hört man doch
                              gerne ;) Hat sich die Arbeit gelohnt :))<br>
                            </div>
                          </div>
                        </blockquote>
                        <br>
                      </div>
                    </div>
                  </blockquote>
                </div>
                <br>
              </div>
              <br>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
  </body>
</html>