The database I am trying to pull data from has approximately 50,000 documents. Currently it takes around 90 seconds for an iOS or Android device to query and display the data to the mobile device in a view. My code is posted below. Is there something I could be doing differently to speed this up? Thanks for any tips.

```
function updateAllPoliciesTable() {
    try {
        var db = Alloy.Globals.dbPolicyInquiry;
        var view = db.getView("AllRecordsByInsured");
        var vec = view.getAllEntriesBySQL("Agent like ? OR MasterAgent like ?", [Ti.App.agentNumber, Ti.App.agentNumber], true);

        var ve = vec.getFirstEntry();
        var data = [];
        while (ve) {
            var unid = ve.getColumnValue("id");
            var row = Ti.UI.createTableViewRow({
                unid : unid,
                height: '45dp',
                rowData: ve.getColumnValue("Insured") + "  " + ve.getColumnValue("PolicyNumber")
            });

            var viewLabel = Ti.UI.createLabel({
                color : '#333',
                font : {
                    fontSize : '16dp'
                },
                text: toTitleCase(ve.getColumnValue("Insured")) + "  " + ve.getColumnValue("PolicyNumber"),
                left: '10dp'
            });

            row.add(viewLabel);
            data.push(row);
            ve = vec.getNextEntry();
        }

        //Ti.API.log("# of policies= " + data.length);

        if(data.length == 0) {
            var row = Ti.UI.createTableViewRow({
                title : "No policies found"
            });
            data.push(row);
        }

        $.AllPoliciesTable.setData(data);
        Alloy.Globals.refreshAllPolicies = false;
        Alloy.Globals.loading.hide();
    } catch (e) {
        DTG.exception("updateAllPoliciesTable -> ", e);
    }
}

```