Fetch third Level Depth Data from taxonomy with performance
You can fetch all child at any level by using this code :

function taxonomy_get_children_all($tid, $vid = 0, $key = 'tid'){
  $c = taxonomy_get_children($tid, $vid, $key);
  $result = array();
  foreach ($c as $t =&gt; $d){
    $result[$t] = $d;
    $below = taxonomy_get_children_all($t, $vid, $key);
    if (!empty($below)) {
      $result[$t]-&gt;children = array();
      foreach ($below as $nt =&gt; $nd){
        $result[$t]-&gt;children[$nt] = $nd;
      }
    }
  }
  return $result;
}


OR

You can do it by adding custom database query using function function taxonomy_get_children