phpbar.de logo

Mailinglisten-Archive

mysql-Zeiten

mysql-Zeiten

Tobias Faust mysql_(at)_lists.phpcenter.de
Sat, 14 Jul 2001 10:26:15 +0200


hi

kann mir jemand sagen wie ich die genaue rechenzeit von MySQL rausbekomme
???

ich möchte gerne wissen wie performant meine Abfragen sind die je nach
Anwendungszwech doch recht komplex sind.

ein EXPLAIN im phpmyadmin bringt auch nix da dort keine zeiten angegeben
werden :(

z.b. geht es um folgende abfrage: Weiß jemand ob dieser aufbau prinzipiell
im hinblick auf performence gut ist ???
es wird aus einer tabelle für jeden tag der traffic ausgerechnet und pro tag
für jede datei ausgegeben

select datei as dateiname,sum(traffic) as gesamt,
if (dayofyear(time) = dayofyear(date_sub(now(),interval 0
day)),sum(traffic),0) as day0,
if (dayofyear(time) = dayofyear(date_sub(now(),interval 1
day)),sum(traffic),0) as day1,
if (dayofyear(time) = dayofyear(date_sub(now(),interval 2
day)),sum(traffic),0) as day2,
if (dayofyear(time) = dayofyear(date_sub(now(),interval 3
day)),sum(traffic),0) as day3,
if (dayofyear(time) = dayofyear(date_sub(now(),interval 4
day)),sum(traffic),0) as day4,
if (dayofyear(time) = dayofyear(date_sub(now(),interval 5
day)),sum(traffic),0) as day5,
if (dayofyear(time) = dayofyear(date_sub(now(),interval 6
day)),sum(traffic),0) as day6,
if (dayofyear(time) = dayofyear(date_sub(now(),interval 7
day)),sum(traffic),0) as day7,
if (dayofyear(time) = dayofyear(date_sub(now(),interval 8
day)),sum(traffic),0) as day8,
if (dayofyear(time) = dayofyear(date_sub(now(),interval 9
day)),sum(traffic),0) as day9,
if (dayofyear(time) = dayofyear(date_sub(now(),interval 10
day)),sum(traffic),0) as day10,
if (dayofyear(time) = dayofyear(date_sub(now(),interval 11
day)),sum(traffic),0) as day11,
if (dayofyear(time) = dayofyear(date_sub(now(),interval 12
day)),sum(traffic),0) as day12,
if (dayofyear(time) = dayofyear(date_sub(now(),interval 13
day)),sum(traffic),0) as day13,
if (dayofyear(time) = dayofyear(date_sub(now(),interval 14
day)),sum(traffic),0) as day14,
if (dayofyear(time) = dayofyear(date_sub(now(),interval 15
day)),sum(traffic),0) as day15,
if (dayofyear(time) = dayofyear(date_sub(now(),interval 16
day)),sum(traffic),0) as day16,
if (dayofyear(time) = dayofyear(date_sub(now(),interval 17
day)),sum(traffic),0) as day17,
if (dayofyear(time) = dayofyear(date_sub(now(),interval 18
day)),sum(traffic),0) as day18,
if (dayofyear(time) = dayofyear(date_sub(now(),interval 19
day)),sum(traffic),0) as day19,
if (dayofyear(time) = dayofyear(date_sub(now(),interval 20
day)),sum(traffic),0) as day20,
if (dayofyear(time) = dayofyear(date_sub(now(),interval 21
day)),sum(traffic),0) as day21,
if (dayofyear(time) = dayofyear(date_sub(now(),interval 22
day)),sum(traffic),0) as day22,
if (dayofyear(time) = dayofyear(date_sub(now(),interval 23
day)),sum(traffic),0) as day23,
if (dayofyear(time) = dayofyear(date_sub(now(),interval 24
day)),sum(traffic),0) as day24,
if (dayofyear(time) = dayofyear(date_sub(now(),interval 25
day)),sum(traffic),0) as day25,
if (dayofyear(time) = dayofyear(date_sub(now(),interval 26
day)),sum(traffic),0) as day26,
if (dayofyear(time) = dayofyear(date_sub(now(),interval 27
day)),sum(traffic),0) as day27,
if (dayofyear(time) = dayofyear(date_sub(now(),interval 28
day)),sum(traffic),0) as day28,
if (dayofyear(time) = dayofyear(date_sub(now(),interval 29
day)),sum(traffic),0) as day29,
if (dayofyear(time) = dayofyear(date_sub(now(),interval 30
day)),sum(traffic),0) as day30,
if (dayofyear(time) = dayofyear(date_sub(now(),interval 31
day)),sum(traffic),0) as day31
from referer
where time > date_sub(now(), interval 31 day)
group by datei
order by gesamt desc

Tabelle sieht so aus:
(jeder dateidownload bringt ein eintrag mit sich)

autoid | datei | traffic | timestamp | undnochvielmehr .....

schonmal thx
tobias
www.traffic-eye.de

---
!!NEU!!
Fragen und Antworten zu MySQL und dieser Liste unter
-->>  http://www.4t2.com/mysql 



php::bar PHP Wiki   -   Listenarchive