http-URI = "http:" "//" authority path-abempty [ "?" query ]
[ "#" fragment ]
query = *( pchar / "/" / "?" )
pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
pct-encoded = "%" HEXDIG HEXDIG
sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
/ "*" / "+" / "," / ";" / "="
ALPHA := [A-Za-z]
DIGIT := [0-9]
HEXDIG := [0-9A-F]
UPDATE `users`
LEFT JOIN (
SELECT `user_id_from`, COUNT(*) AS `count` FROM `messages` GROUP BY `user_id_from`
) AS `from` ON `from`.`user_id_from` = `users`.`user_id`
LEFT JOIN (
SELECT `user_id_to`, COUNT(*) AS `count` FROM `messages` GROUP BY `user_id_to`
) AS `to` ON `to`.`user_id_to` = `users`.`user_id`
SET `users`.`sended` = IFNULL(`from`.`count`, 0),
`users`.`received` = IFNULL(`to`.`count`, 0)
...
idmap config NT AUTHORITY : base_rid = 0
idmap config NT AUTHORITY : range = 1200000-1299999
idmap config NT AUTHORITY : backend = rid
idmap config BUILTIN : base_rid = 0
idmap config BUILTIN : range = 1000000-1099999
idmap config BUILTIN : backend = rid
idmap config REGIONS : base_rid = 100
idmap config REGIONS : range = 100-999999
idmap config REGIONS : backend = rid
idmap config REGIONS : default = yes
idmap config * : range = 1300000-1999999
idmap config * : backend = rid