Skip to content

Instantly share code, notes, and snippets.

@bcmiller
Created May 18, 2010 16:53
Show Gist options
  • Save bcmiller/405228 to your computer and use it in GitHub Desktop.
Save bcmiller/405228 to your computer and use it in GitHub Desktop.
Reading mysql slow query log from /var/run/mysqld/mysqld-slow.log
Count: 2 Time=38237.01s (76474s) Lock=0.00s (0s) Rows=0.0 (0), apci[apci]@loc
alhost
SELECT DISTINCT users.uid AS uid,
users.picture AS users_picture,
users.name AS users_name
FROM users users
INNER JOIN og_rap_uid og_rap_uid ON users.uid = og_rap_uid.uid
INNER JOIN og_rap og_rap_og_rap_uid ON og_rap_uid.rid = og_rap_og_rap_uid.rid
INNER JOIN og_rap_uid og_rap_og_rap_uid__og_rap_uid ON og_rap_og_rap_uid.rid =
og_rap_og_rap_uid__og_rap_uid.rid
INNER JOIN users users_og_rap_uid ON og_rap_og_rap_uid__og_rap_uid.uid = users
_og_rap_uid.uid
LEFT JOIN og_uid spaces_og_ogu ON users.uid = spaces_og_ogu.uid
JOIN node spaces_og_n ON spaces_og_ogu.nid = spaces_og_n.nid WHERE (
(spaces_og_ogu.nid IN (N, N, N, N, N, N, N, N, N, N, N, N) AND spaces_og_n.sta
tus = N) OR
(users.uid = N)) AND ( (og_rap_og_rap_uid.friend <> N) AND (users.uid <> N)
AND (users_og_rap_uid.uid = N)
)
Count: 10 Time=35241.23s (352412s) Lock=0.00s (0s) Rows=0.0 (0), apci[apci]@l
ocalhost
SELECT DISTINCT users.uid AS uid,
users.picture AS users_picture,
users.name AS users_name
FROM users users
INNER JOIN og_rap_uid og_rap_uid ON users.uid = og_rap_uid.uid
INNER JOIN og_rap og_rap_og_rap_uid ON og_rap_uid.rid = og_rap_og_rap_uid.rid
INNER JOIN og_rap_uid og_rap_og_rap_uid__og_rap_uid ON og_rap_og_rap_uid.rid =
og_rap_og_rap_uid__og_rap_uid.rid
INNER JOIN users users_og_rap_uid ON og_rap_og_rap_uid__og_rap_uid.uid = users
_og_rap_uid.uid
LEFT JOIN og_uid spaces_og_ogu ON users.uid = spaces_og_ogu.uid
JOIN node spaces_og_n ON spaces_og_ogu.nid = spaces_og_n.nid WHERE (
(spaces_og_ogu.nid IN (N) AND spaces_og_n.status = N) OR
(users.uid = N)) AND ( (og_rap_og_rap_uid.friend <> N) AND (users.uid NOT IN
(N, N,N,N)) AND (users_og_rap_uid.uid IN (N, N,N,N))
)
Count: 4 Time=12802.10s (51208s) Lock=0.00s (0s) Rows=0.0 (0), apci[apci]@loc
alhost
SELECT DISTINCT users.uid AS uid,
users.picture AS users_picture,
users.name AS users_name
FROM users users
INNER JOIN og_rap_uid og_rap_uid ON users.uid = og_rap_uid.uid
INNER JOIN og_rap og_rap_og_rap_uid ON og_rap_uid.rid = og_rap_og_rap_uid.rid
INNER JOIN og_rap_uid og_rap_og_rap_uid__og_rap_uid ON og_rap_og_rap_uid.rid =
og_rap_og_rap_uid__og_rap_uid.rid
INNER JOIN users users_og_rap_uid ON og_rap_og_rap_uid__og_rap_uid.uid = users
_og_rap_uid.uid
LEFT JOIN og_uid spaces_og_ogu ON users.uid = spaces_og_ogu.uid
JOIN node spaces_og_n ON spaces_og_ogu.nid = spaces_og_n.nid WHERE (
(spaces_og_ogu.nid IN (N, N) AND spaces_og_n.status = N) OR
(users.uid = N)) AND ( (og_rap_og_rap_uid.friend <> N) AND (users.uid <> N)
AND (users_og_rap_uid.uid = N)
)
Count: 3 Time=954.79s (2864s) Lock=0.00s (0s) Rows=0.0 (0), apci[apci]@localh
ost
SELECT DISTINCT users.uid AS uid,
users.picture AS users_picture,
users.name AS users_name
FROM users users
INNER JOIN og_rap_uid og_rap_uid ON users.uid = og_rap_uid.uid
INNER JOIN og_rap og_rap_og_rap_uid ON og_rap_uid.rid = og_rap_og_rap_uid.rid
INNER JOIN og_rap_uid og_rap_og_rap_uid__og_rap_uid ON og_rap_og_rap_uid.rid =
og_rap_og_rap_uid__og_rap_uid.rid
INNER JOIN users users_og_rap_uid ON og_rap_og_rap_uid__og_rap_uid.uid = users
_og_rap_uid.uid
LEFT JOIN og_uid spaces_og_ogu ON users.uid = spaces_og_ogu.uid
JOIN node spaces_og_n ON spaces_og_ogu.nid = spaces_og_n.nid WHERE (
(spaces_og_ogu.nid IN (N, N, N, N, N, N, N, N, N, N, N) AND spaces_og_n.status
= N) OR
(users.uid = N)) AND ( (og_rap_og_rap_uid.friend <> N) AND (users.uid <> N)
AND (users_og_rap_uid.uid = N)
)
Count: 1 Time=946.89s (946s) Lock=0.00s (0s) Rows=0.0 (0), apci[apci]@localho
st
SELECT DISTINCT users.uid AS uid,
users.picture AS users_picture,
users.name AS users_name
FROM users users
INNER JOIN og_rap_uid og_rap_uid ON users.uid = og_rap_uid.uid
INNER JOIN og_rap og_rap_og_rap_uid ON og_rap_uid.rid = og_rap_og_rap_uid.rid
INNER JOIN og_rap_uid og_rap_og_rap_uid__og_rap_uid ON og_rap_og_rap_uid.rid =
og_rap_og_rap_uid__og_rap_uid.rid
INNER JOIN users users_og_rap_uid ON og_rap_og_rap_uid__og_rap_uid.uid = users
_og_rap_uid.uid
LEFT JOIN og_uid spaces_og_ogu ON users.uid = spaces_og_ogu.uid
JOIN node spaces_og_n ON spaces_og_ogu.nid = spaces_og_n.nid WHERE (
(spaces_og_ogu.nid IN (N, N, N, N, N, N, N, N, N, N) AND spaces_og_n.status =
N) OR
(users.uid = N)) AND ( (og_rap_og_rap_uid.friend <> N) AND (users.uid <> N)
AND (users_og_rap_uid.uid = N)
)
Count: 15 Time=122.68s (1840s) Lock=0.00s (0s) Rows=3.0 (45), apci[apci]@loca
lhost
SELECT DISTINCT node.type AS node_type
FROM node node
LEFT JOIN content_field_owners node_data_field_owners ON node.vid = node_data_
field_owners.vid
LEFT JOIN users users_node_data_field_owners ON node_data_field_owners.field_o
wners_uid = users_node_data_field_owners.uid
LEFT JOIN og_uid og_uid ON node.nid = og_uid.nid
LEFT JOIN users users ON node.uid = users.uid
LEFT JOIN content_field_league content_field_league ON node.nid = content_fiel
d_league.field_league_nid
LEFT JOIN apci_register apci_register ON content_field_league.nid = apci_regis
ter.nid
WHERE ((node.status <> N) AND (node.type in ('S', 'S', 'S', 'S')))
AND ((og_uid.uid = N) OR ((users.uid = N) AND (users.uid IS NOT NULL)) OR (a
pci_register.uid = N) OR (users_node_data_field_owners.uid = N))
GROUP BY node_type
ORDER BY node_type ASC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment