I have config the mysql to log the queries and seems that some queries are fool.
180228 16:38:32 364 Connect root@localhost as anonymous on fog
364 Query USE `fog`
364 Query SET SESSION sql_mode=''
365 Connect root@localhost as anonymous on fog
365 Query USE `fog`
364 Quit
365 Query SET SESSION sql_mode=''
366 Connect root@localhost as anonymous on fog
366 Query USE `fog`
365 Quit
366 Query SET SESSION sql_mode=''
366 Query SELECT `vValue` FROM `fog`.`schemaVersion`
366 Query SELECT `pName` FROM `plugins` WHERE `plugins`.`pInstalled`='1' AND `plugins`.`pState`='1' ORDER BY LOWER(`plugins`.`pName`) ASC
366 Query SELECT `settingValue` FROM `globalSettings` WHERE `globalSettings`.`settingKey` IN ('FOG_DEFAULT_LOCALE','FOG_HOST_LOOKUP','FOG_MEMORY_LIMIT','FOG_REAUTH_ON_DELETE','FOG_REAUTH_ON_EXPORT','FOG_TZ_INFO','FOG_VIEW_DEFAULT_SCREEN') ORDER BY LOWER(`globalSettings`.`settingKey`) ASC
366 Query SELECT COUNT(`hosts`.`hostID`) AS `total` FROM `hosts` WHERE `hostPending` = '1' LIMIT 1
366 Query SELECT COUNT(`COLUMN_NAME`)AS`total`FROM`information_schema`.`COLUMNS`WHERE`TABLE_SCHEMA`='fog'AND`TABLE_NAME`='hostMAC'AND`COLUMN_NAME`='hmMAC'
366 Query SELECT COUNT(`hostMAC`.`hmID`) AS `total` FROM `hostMAC` WHERE `hmPending` = '1' LIMIT 1
366 Query SELECT `settingValue` FROM `globalSettings` WHERE `globalSettings`.`settingKey` IN ('FOG_URL_AVAILABLE_TIMEOUT','FOG_URL_BASE_CONNECT_TIMEOUT','FOG_URL_BASE_TIMEOUT') ORDER BY LOWER(`globalSettings`.`settingKey`) ASC
366 Query SELECT `globalSettings`.* FROM `globalSettings` WHERE `settingKey`='FOG_QUICKREG_PENDING_MAC_FILTER'
366 Query SELECT COUNT(`hostMAC`.`hmID`) AS `total` FROM `hostMAC` WHERE `hmMAC` IN ('40:b0:34:39:57:ac') AND `hmPending` IN ('0','') LIMIT 1
366 Query SELECT `hmMAC` FROM `hostMAC` WHERE `hostMAC`.`hmMAC` IN ('40:b0:34:39:57:ac') AND `hostMAC`.`hmPending` IN ('0','') ORDER BY `hostMAC`.`hmID` ASC
366 Query SELECT `hmMAC` FROM `hostMAC` WHERE `hostMAC`.`hmMAC` IN ('40:b0:34:39:57:ac') AND `hostMAC`.`hmIgnoreImaging`='1' ORDER BY `hostMAC`.`hmID` ASC
366 Query SELECT `hostMAC`.* FROM `hostMAC` WHERE `hmMAC`='40:b0:34:39:57:ac'
366 Query SELECT `hmHostID` FROM `hostMAC` WHERE `hostMAC`.`hmPending` IN ('0','') AND `hostMAC`.`hmMAC` IN ('40:b0:34:39:57:ac') ORDER BY `hostMAC`.`hmID` ASC
366 Query SELECT `hosts`.*,`hostMAC`.*,`images`.*,`os`.*,`imagePartitionTypes`.*,`imageTypes`.*,`hostScreenSettings`.*,`hostAutoLogOut`.*,`inventory`.* FROM `hosts` LEFT OUTER JOIN `hostMAC` ON `hostMAC`.`hmHostID`=`hosts`.`hostID` LEFT OUTER JOIN `images` ON `images`.`imageID`=`hosts`.`hostImage` LEFT OUTER JOIN `os` ON `os`.`osID`=`images`.`imageOSID` LEFT OUTER JOIN `imagePartitionTypes` ON `imagePartitionTypes`.`imagePartitionTypeID`=`images`.`imagePartitionTypeID` LEFT OUTER JOIN `imageTypes` ON `imageTypes`.`imageTypeID`=`images`.`imageTypeID` LEFT OUTER JOIN `hostScreenSettings` ON `hostScreenSettings`.`hssHostID`=`hosts`.`hostID` LEFT OUTER JOIN `hostAutoLogOut` ON `hostAutoLogOut`.`haloHostID`=`hosts`.`hostID` LEFT OUTER JOIN `inventory` ON `inventory`.`iHostID`=`hosts`.`hostID` WHERE `hostID`='7502' AND `hostMAC`.`hmPrimary` = '1'
366 Query SELECT COUNT(`hookEvents`.`heName`) AS `total` FROM `hookEvents` WHERE `hookEvents`.`heName`='QUEUED_STATES' AND `hookEvents`.`heName` <> '0'
366 Query SELECT COUNT(`hookEvents`.`heName`) AS `total` FROM `hookEvents` WHERE `hookEvents`.`heName`='PROGRESS_STATE' AND `hookEvents`.`heName` <> '0'
366 Query SELECT `taskID` FROM `tasks` LEFT OUTER JOIN `images` ON `images`.`imageID`=`tasks`.`taskImageID` LEFT OUTER JOIN `os` ON `os`.`osID`=`images`.`imageOSID` LEFT OUTER JOIN `imagePartitionTypes` ON `imagePartitionTypes`.`imagePartitionTypeID`=`images`.`imagePartitionTypeID` LEFT OUTER JOIN `imageTypes` ON `imageTypes`.`imageTypeID`=`images`.`imageTypeID` LEFT OUTER JOIN `hosts` ON `hosts`.`hostID`=`tasks`.`taskHostID` LEFT OUTER JOIN `hostMAC` ON `hostMAC`.`hmHostID`=`hosts`.`hostID` LEFT OUTER JOIN `hostScreenSettings` ON `hostScreenSettings`.`hssHostID`=`hosts`.`hostID` LEFT OUTER JOIN `hostAutoLogOut` ON `hostAutoLogOut`.`haloHostID`=`hosts`.`hostID` LEFT OUTER JOIN `inventory` ON `inventory`.`iHostID`=`hosts`.`hostID` LEFT OUTER JOIN `taskTypes` ON `taskTypes`.`ttID`=`tasks`.`taskTypeID` LEFT OUTER JOIN `taskStates` ON `taskStates`.`tsID`=`tasks`.`taskStateID` LEFT OUTER JOIN `nfsGroupMembers` ON `nfsGroupMembers`.`ngmID`=`tasks`.`taskNFSMemberID` LEFT OUTER JOIN `nfsGroups` ON `nfsGroups`.`ngID`=`nfsGroupMembers`.`ngmGroupID` WHERE `tasks`.`taskHostID`='7502' AND `tasks`.`taskStateID` IN ('0','1','2','3') AND `hostMAC`.`hmPrimary` = '1' ORDER BY LOWER(`tasks`.`taskName`) ASC
366 Query SELECT `hostMAC`.* FROM `hostMAC` WHERE `hmMAC`='40:b0:34:39:57:ac'
366 Quit
In one second queries