Я сейчас этим занимаюсь. Кому поможет - вылаживаю запрос чтобы выгрести всех юзверов:
SELECT DISTINCT
u.id AS id,
u.login AS login,
u.password AS password,
u.full_name AS fio,
a.balance AS balance,
a.credit * (-1) AS credit,
u.create_date AS cdate,
u.actual_address AS address,
u.flat_number AS flat,
u.entrance AS entrance,
u.floor AS `floor`,
u.work_telephone AS wphone,
u.home_telephone AS hphone,
u.mobile_telephone AS mphone,
u.icq_number AS icq,
u.email AS email,
ugl.group_id AS grp,
atl.tariff_id AS tariff_now,
atl.next_tariff_id AS tariff_next,
CONCAT((ipg.ip>>24)&0xFF,'.',(ipg.ip>>16)&0xFF,'.',(ipg.ip>>8)&0xFF,'.',ipg.ip&0xFF) AS ip,
CONCAT((ipg.mask>>24)&0xFF,'.',(ipg.mask>>16)&0xFF,'.',(ipg.mask>>8)&0xFF,'.',ipg.mask&0xFF) AS netmask,
ipg.mac AS mac,
ipg.uname AS ip_login,
ipg.upass AS ip_password,
ipg.ip_type AS is_ethernet
FROM users u, users_accounts ua, accounts a, users_groups_link ugl, account_tariff_link atl, service_links sl, services_data sd, iptraffic_service_links ipsl, ip_groups ipg
WHERE
ua.uid=u.id AND ua.is_deleted='0'
AND
a.id=ua.account_id AND a.is_deleted='0'
AND
ugl.user_id=u.id
AND
atl.account_id=ua.account_id AND atl.is_deleted='0'
AND
sl.account_id=ua.account_id AND sl.tariff_link_id = atl.id AND sl.is_deleted='0'
AND
sd.id=sl.service_id AND sd.is_deleted='0'
AND
ipsl.id=sl.id AND ipsl.is_deleted='0'
AND
ipg.ip_group_id=ipsl.ip_group_id AND ipg.is_deleted='0'
AND
u.is_deleted='0'
AND
sd.service_type='3'
;
Перед запросом желательно сделать
ALTER TABLE `users_accounts` ADD INDEX `account_id` (`account_id`);
ALTER TABLE `service_links` ADD INDEX `account_id` (`account_id`), ADD INDEX `service_id` (`service_id`), ADD INDEX `is_deleted` (`is_deleted`);
ALTER TABLE `services_data` ADD INDEX `service_type` (`service_type`), ADD INDEX `is_deleted` (`is_deleted`);
ALTER TABLE `ip_groups` ADD INDEX `ip_group_id` (`ip_group_id`);
ALTER TABLE `iptraffic_service_links` ADD INDEX `ip_group_id` (`ip_group_id`);
- сэкономите кучу времени
ЗЫ: Версия УТМа - 5.2.1-005