|-
| '''Summary'''
|Optimizes the meta data and indexes of the database {{Code|$db}}.<br/>If {{Code|$all}} is {{Code|true}}, the complete database will be rebuilt.<br/>The usage of the {{Code|$options}} argument can be used to control indexing. The syntax is identical to the [[#db:create|db:create]] function, except that no parsing . Allowed options can be specified, are all [[Options#Indexing|indexing]] and [[Options#Full-Text|full-text]] options in lower case. [[Options#UPDINDEX|UPDINDEX]] is only allowed if {{Code|$all}} is {{Code|true}}.
|-
| '''Errors'''