Check out example codes for "codeigniter dbforge add index". It will help you in understanding the concepts better.

Code Example 1

$sql = "CREATE INDEX your_index_name ON table_name(field_name)";
$this->db->query($sql);

Learn ReactJs, React Native from akashmittal.com