Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Performance issue in the listGrid report

    I am facing issue with the perfomance of listGrid for populating 20,000 records on the screen. It is taking huge amount of time to complete the process.

    I am using smartgwt 2.4 version.

    The issue is with the client side as the server side is completing the process in half minute.

    Below is the DetailedReportListGrid logic :

    public DetailedReportListGrid()
    {
    setCanSort(true);
    setWidth100();
    setHeight100();
    setSelectionType(SelectionStyle.MULTIPLE);
    setShowFilterEditor(true);
    setFilterOnKeypress(true);
    setFilterEditorHeight(20);
    setHeaderHeight(30);
    setAutoFetchData(true);
    setHoverWidth(200);
    setCanReorderFields(false);
    setAutoFitMaxRecords(5);
    addDataArrivedHandler(new DataArrivedHandler()
    {
    @Override
    public void onDataArrived(DataArrivedEvent event)
    {
    markForRedraw();
    }
    });

    ListGridField adminLevel1Field = new ListGridField("adminLevel1", "Admin Level 1");
    adminLevel1Field.setWidth("100px");
    adminLevel1Field.setCanFilter(true);

    ListGridField adminLevel2Field = new ListGridField("adminLevel2", "Admin Level 2");
    adminLevel2Field.setWidth("100px");
    adminLevel2Field.setCanFilter(true);

    ListGridField adminLevel3Field = new ListGridField("adminLevel3", "Admin Level 3");
    adminLevel3Field.setWidth("100px");
    adminLevel3Field.setCanFilter(true);

    ListGridField adminLevel4Field = new ListGridField("adminLevel4", "Admin Level 4");
    adminLevel4Field.setWidth("100px");
    adminLevel4Field.setCanFilter(true);

    ListGridField adminLevel5Field = new ListGridField("adminLevel5", "Admin Level 5");
    adminLevel5Field.setWidth("100px");
    adminLevel5Field.setCanFilter(true);

    ListGridField ruleCodeField = new ListGridField("ruleCode", "Rule Code");
    ruleCodeField.setWidth("80px");
    ruleCodeField.setCanFilter(true);

    ListGridField ruleNameField = new ListGridField("ruleName", "Rule Name");
    ruleNameField.setWidth("250px");
    ruleNameField.setCanFilter(true);
    ruleNameField.setShowHover(true);

    ListGridField severityField = new ListGridField("severity", "Severity");
    severityField.setWidth("80px");
    severityField.setType(ListGridFieldType.INTEGER);
    severityField.setCanFilter(true);

    ListGridField statusField = new ListGridField("lestatus", "LE Status");
    statusField.setWidth("50px");
    statusField.setCanFilter(true);

    ListGridField validationIdField = new ListGridField("validationId", "Validation Id");
    validationIdField.setWidth("100px");
    validationIdField.setCanFilter(true);

    ListGridField userIdField = new ListGridField("userId", "User Id");
    userIdField.setWidth("80px");
    userIdField.setCanFilter(true);

    ListGridField leReasonField = new ListGridField("leReason", "LE Reason");
    leReasonField.setWidth("100px");
    leReasonField.setCanFilter(true);

    ListGridField timestampField = new ListGridField("timestamp", "Timestamp");
    timestampField.setShowHover(true);
    timestampField.setWidth("100px");
    timestampField.setCanFilter(true);

    ListGridField remarkField = new ListGridField("remark", "Remark");
    remarkField.setWidth("100px");
    remarkField.setCanFilter(true);

    ListGridField messageField = new ListGridField("message", "Message");
    messageField.setWidth("250px");
    messageField.setShowHover(true);
    messageField.setCanFilter(true);

    ListGridField wavStatusField = new ListGridField("wavStatus", "WAV Status");
    wavStatusField.setWidth("80px");
    wavStatusField.setCanFilter(true);

    ListGridField projectNameField = new ListGridField("projectName", "Project Name");
    projectNameField.setWidth("100px");
    projectNameField.setCanFilter(true);

    this.setFields(adminLevel1Field, adminLevel2Field, adminLevel3Field, adminLevel4Field, adminLevel5Field,
    ruleCodeField, ruleNameField, severityField, statusField, validationIdField, userIdField,
    leReasonField, timestampField, remarkField, messageField, wavStatusField, projectNameField);

    initContextMenuSummaryReport();
    }

    #2
    Populating 20,000 records to the front end is definitely not a good approach. However fast your queries may be, the browser will choke. Try to make use of the features like filter etc to create a nice user experience around this huge data set. Though you populate 20000 records in a flash, its 99.9% improbable that user will use the scroll-er to navigate through the data. It's not user friendly for such huge data sets. We show only 1000 records and the user has to filter, to show more appropriate data.

    Thanks.

    Comment


      #3
      Thanks Harsha.. But what could be done to display only 1000 records of the selected 20000 records in the screen and on scrolling navigate remaining data.

      Comment


        #4
        Hi,

        This is how a listgrid is supposed to function by default(Paging Mode). Go through the quick start guide to learn more about the different modes of data pull available for listgrid. The number of records pulled can be controlled with the following method: setDataPageSize(1000)

        thanks.

        Comment


          #5
          Does filter mean hitting the database and getting the value? Because we are using filter builder in our application for filtering which actually works on datasource. So, there is no database hit.

          So, in this scenario, is there any way to display only 1000 records in the screen and have different datasource which will have all 20000 records and will be used by filterbuilder.

          Comment


            #6
            You can have both clients side / server side filtering. The filter I was referring to was the server side filtering. Refer to the smartgwtee showcase examples at:

            http://www.smartclient.com/smartgwtee/showcase/

            Comment

            Working...
            X