class_docstr: A database composed of multiple databases, allowing users to guide IR rewriting using
  combined knowledge of those databases. To each query, it returns the best record among all the
  databases given.
  
  Examples
  --------
  Examples below demonstrate the usecases of and difference between UnionDatabase and
  OrderDatabase.
  
  Assumption:
  * db1, db2 do not have tuning records for the target workload.
  * Each of db3, db4, db5 has tuning records r3, r4, r5 for target workload respectively.
  
  .. code-block:: python
  
  #### Case 1. `UnionDatabase`:
  merged_db = ms.database.UnionDatabase(
      db1, # no record
      db2, # no record
      db3, # has r3
      db4  # has r4
  )
  # returns the better one between r3 and r4
  merged_db.query_tuning_record(..., target_workload)
  
  ### Case 2. `OrderedUnionDatabase`
  merged_db = ms.database.OrderedUnionDatabase(
      db1, # no record
      db2, # no record
      db3, # has r3
      db4  # has r4
  )
  # returns r3
  merged_db.query_tuning_record(..., target_workload)
  
  ### Case 3. Mix-use scenario
  merged_db = ms.database.UnionDatabase(
      db1, # no record
      db2, # no record
      db3, # has r3
      ms.database.OrderedUnionDatabase( # returns r4
          db4,  # has r4
          db5,  # has r5
      )
  )
  # returns the better one between r3 and r4
  merged_db.query_tuning_record(..., target_workload)
  
  ### Case 4. Another mix-use scenario
  merged_db = ms.database.UnionDatabase(
      db1, # no record
      db2, # no record
      db3, # has r3
      ms.database.UnionDatabase( # returns best one between r4 and r5
          db4,  # has r4
          db5,  # has r5
      )
  )
  # returns the best one among r3, r4 and r5
  merged_db.query_tuning_record(..., target_workload)
  
  ### Case 5. Yet another mix-use scenario
  merged_db = ms.database.OrderedUnionDatabase(
      db1, # no record
      db2, # no record
      ms.database.UnionDatabase( # returns best one between r3 and r4
          db3, # has r3
          db4,  # has r4
      )
      db5,  # has r5
  )
  # returns the better one between r3 and r4
  merged_db.query_tuning_record(..., target_workload)
class_docstr_tok: ["A","database","composed","of","multiple","databases",",","allowing","users","to","guide","IR","rewriting","using","combined","knowledge","of","those","databases",".","To","each","query",",","it","returns","the","best","record","among","all","the","databases","given",".","Examples","--","--","--","--","Examples","below","demonstrate","the","usecases","of","and","difference","between","UnionDatabase","and","OrderDatabase",".","Assumption",":","*","db1",",","db2","do","not","have","tuning","records","for","the","target","workload",".","*","Each","of","db3",",","db4",",","db5","has","tuning","records","r3",",","r4",",","r5","for","target","workload","respectively",".","..","code-block",":",":","python","#","#","#","#","Case","1",".","`","UnionDatabase","`",":","merged_db","=","ms.database.UnionDatabase","(","db1",",","#","no","record","db2",",","#","no","record","db3",",","#","has","r3","db4","#","has","r4",")","#","returns","the","better","one","between","r3","and","r4","merged_db.query_tuning_record","(","...",",","target_workload",")","#","#","#","Case","2",".","`","OrderedUnionDatabase","`","merged_db","=","ms.database.OrderedUnionDatabase","(","db1",",","#","no","record","db2",",","#","no","record","db3",",","#","has","r3","db4","#","has","r4",")","#","returns","r3","merged_db.query_tuning_record","(","...",",","target_workload",")","#","#","#","Case","3",".","Mix-use","scenario","merged_db","=","ms.database.UnionDatabase","(","db1",",","#","no","record","db2",",","#","no","record","db3",",","#","has","r3","ms.database.OrderedUnionDatabase","(","#","returns","r4","db4",",","#","has","r4","db5",",","#","has","r5",")",")","#","returns","the","better","one","between","r3","and","r4","merged_db.query_tuning_record","(","...",",","target_workload",")","#","#","#","Case","4",".","Another","mix-use","scenario","merged_db","=","ms.database.UnionDatabase","(","db1",",","#","no","record","db2",",","#","no","record","db3",",","#","has","r3","ms.database.UnionDatabase","(","#","returns","best","one","between","r4","and","r5","db4",",","#","has","r4","db5",",","#","has","r5",")",")","#","returns","the","best","one","among","r3",",","r4","and","r5","merged_db.query_tuning_record","(","...",",","target_workload",")","#","#","#","Case","5",".","Yet","another","mix-use","scenario","merged_db","=","ms.database.OrderedUnionDatabase","(","db1",",","#","no","record","db2",",","#","no","record","ms.database.UnionDatabase","(","#","returns","best","one","between","r3","and","r4","db3",",","#","has","r3","db4",",","#","has","r4",")","db5",",","#","has","r5",")","#","returns","the","better","one","between","r3","and","r4","merged_db.query_tuning_record","(","...",",","target_workload",")"]
docstr: Construct a merged database from multiple databases.
  
  Parameters
  ----------
  *databases : Database
      The list of databases to combine.
docstr_tok: ["Construct","a","merged","database","from","multiple","databases",".","Parameters","--","--","--","--","--","*","databases",":","Database","The","list","of","databases","to","combine","."]
code: def __init__(self, *databases: Database) -> None:
      """Construct a merged database from multiple databases.
  
      Parameters
      ----------
      *databases : Database
          The list of databases to combine.
      """
      self.__init_handle_by_constructor__(
          _ffi_api.DatabaseUnionDatabase,  # type: ignore # pylint: disable=no-member
          databases,
      )
  
imports: from tvm._ffi import register_object
  from ..None import _ffi_api
  from .database import Database
label_desc: Use image node_id 1 to create a new UnionDatabase object from inherited base classes: Database with example: obj = UnionDatabase()