Tip.

Metadata does not change from one row to the other and accessing it takes time, so removing it from the row loop would improve the execution speed:

Class User.Test
{

Query TestQuery() As %SQLQuery
{
SELECT * FROM Sample.Person
}

/// do ##class(User.Test).Test()
ClassMethod Test()
{
    for method = "EveryRow", "Once" {
        set rSet = ..TestQueryFunc()
        
        set start = $zh
        do $classmethod(, method, rSet)
        set end = $zh
        
        write $$$FormatText("Method %1 took %2 sec.", method, end - start), !
    }
}

ClassMethod EveryRow(rSet As %SQL.ISelectResult)
{
    
    set tResults = []
    while rSet.%Next() {
        set tRow = {}
        set tMetadata = rSet.%GetMetadata()
        set tColumnCount = tMetadata.columns.Count()
        for x=1:1:tColumnCount {
            set tColumn = tMetadata.columns.GetAt(x)
            set tColumnName = tColumn.colName
            //do tRow.%Set(tColumnName, rSet.%GetData(x) )
            set $PROPERTY(tRow,tColumnName) = $PROPERTY(rSet,tColumnName)
        }
        do tResults.%Push(tRow)
    }
}

ClassMethod Once(rSet As %SQL.ISelectResult)
{
    set tResults = []
    set tColumns = ""
    
    set tMetadata = rSet.%GetMetadata()
    set tColumnCount = tMetadata.columns.Count()
    for x=1:1:tColumnCount {
        set tColumn = tMetadata.columns.GetAt(x)
        set tColumnName = tColumn.colName
        set tColumns = tColumns _ $lb(tColumnName)
    }

    while rSet.%Next() {
        set tRow = {}
        for x=1:1:tColumnCount {
            do tRow.%Set($lg(tColumns, x), rSet.%GetData(x) )
        }
        do tResults.%Push(tRow)
    }
}

}

Results for me:

>do ##class(User.Test).Test()
Method EveryRow took .017803 sec.
Method Once took .01076 sec.

I've got minimal security settings

Then you don't need to provide user and password.

  I can use this method right Login(Username As %String, Password As %String)?

No. First line of script - user, second line - password. After that - ObjectScript.

Do $system.OBJ.Load("Installer.xml", "c") I dont know why. 

Try full path. Also this method returns status, check it:

Set sc =  $system.OBJ.Load("/path/to/Installer.xml", "c")
Write:('sc) $System.Status.GetErrorText(sc) 

First two lines of your script should probably be user and password, unless you're running a minimal security install or enabled OS authentication.

ObjectScript code after that, yes, sothis looks correct

do ##class(User.Installer).setup()  

Maybe you need to load User.Installer beforehand?

Use $system.OBJ.Load(file, "c") to load and compile class(es) you need.

Use ccontrol qlist to get structured information about available instances.

ccontrol qlist [<instance>] [nodisplay > outputfile]
Display a quick list of information about all installed instances, in a format suitable for parsing in command scripts.
The record for an instance contains fields separated by "^" (carats):

  • Field 1: instance name
  • Field 2: instance directory
  • Field 3: version identifier
  • Field 4: current status for the instance
  • Field 5: configuration file name last used
  • Field 6: SuperServer port number
  • Field 7: WebServer port number
  • Field 8: JDBC Gateway port number
  • Field 9: Instance status (e.g., ok, warn, alert)
  • Field 10: Product name of the instance
  • Field 11: Mirror Member Type (e.g., Failover, Disaster Recovery)
  • Field 12: Mirror Status (e.g., Primary, Backup, Connected)