db: ported update_batch() from CI, ported get_deep_array() from T3
db up
fixed several not important sql queries
rewrite small fix related to patterns