v9.0p_2013-12-11/PowerEdition Deployment (built 2013-12-11)
Browser: Firefox 25.0.1
System: Win 7, Win 8
I'm having performance problems using custom DS's.
Basically the situation looks following:
I have a dynamic growing DB table. And i want to load data in to a ListGrid every couple of seconds.
ListGrid :
fetch:
At the beginning everything works fine i have a small slow down when fetch is called, but with increasing data, the slow down unables the ussage of the appliactation, becouse it becomes so long that the next fetch is called and the circle begins. Ataround 20k of recs the slow down starts to be unhandable. Every next fetch provieds ~1k of records.
The record dosent seam to be to havy
What i need is that the listgrid can sort/filter during data loading on the already provided data or on the DB table (which grows can grow to even 200k and larger sets records) the data should be paged to sets of 100 - 1k data sets, but the number of total records in grid summary should show the actuall size of the table.
I'm showing the number of records in the summary fields of one of the fields
Question:
How should I fetch the data?
Browser: Firefox 25.0.1
System: Win 7, Win 8
I'm having performance problems using custom DS's.
Basically the situation looks following:
I have a dynamic growing DB table. And i want to load data in to a ListGrid every couple of seconds.
ListGrid :
Code:
setDataFetchMode(FetchMode.PAGED); setDataPageSize(1000); setShowAllRecords(false); setShowFilterEditor(true); setAllowFilterExpressions(true); setFastCellUpdates(true); setShowRollOver(false); setShowGridSummary(true); setShowRecordComponents(true); setShowRecordComponentsByCell(true);
Code:
DataSource dataSource = getMessageGrid().getDataSource(); dataSource.setAllowAdvancedCriteria(true); DSRequest request = new DSRequest(); request.setSortBy(getMessageGrid().getSort()); dataSource.fetchData(crit, new DSCallback() { @Override public void execute(DSResponse response, Object rawData, DSRequest request) { try { getMessageGrid().setShowFilterEditor(true); getPresenter().getView().getMassReviewUpperBar().getAdvancedFilter().setDisabled(false); DataSource dataSource = getMessageGrid().getDataSource(); final ResultSet resultset = new ResultSet(); resultset.setDataSource(dataSource); resultset.setCriteria(getMessageGrid().getCriteria()); resultset.setFetchMode(FetchMode.PAGED); resultset.setInitialLength(response.getTotalRows()); Record[] responseData = response.getData(); Record[] initialData = new Record[response.getEndRow()+1]; for (int i = 0; i <= response.getEndRow()-1; i++) { if (i < response.getStartRow()) initialData[i] = null; else initialData[i] = responseData[i-response.getStartRow()]; } resultset.setInitialData(initialData); resultset.setInitialSort(getMessageGrid().getSort()); getMessageGrid().setData(resultset); resultset.destroy(); getMessageGrid().filterByEditor(); } catch (ClassCastException e) { getPresenter().getView().getExportBar().showFinishedWithErrorsLabel(); getPresenter().getView().getFilterBar().showFinishedWithErrorsLabel(); } } }, request);
The record dosent seam to be to havy
Code:
<fields> <field name="id" type="integer" title="id" primaryKey="true" hidden="true"/> <field name="bcc" type="text" title="bcc" /> <field name="cc" type="text" tite="cc" /> <field name="extern_type" type="integer" title="type"/> <field name="hadoop_file_id" type="integer" title="hadoopFieldID" /> <field name="import_date" type="date" title="import_date" /> <field name="privilege_status" type="integer" title="pStatus"/> <field name="recipient" type="text" title="to" /> <field name="review_status" type="integer" title="reviewed"/> <field name="sender" type="text" title="from" /> <field name="sent_date" type="datetime" title="datefield"/> <field name="subject" type="text" tite="subject" /> <field name="sys_creation_date" type="date" title="sys_creation_date"/> <field name="technology" type="integer" title="type"/> <field name="query_info_id" type="integer" primaryKey="true" title="query_info_id" hidden="true"/> <field name="annotated" type="boolean" title="hasAnnotations" /> <field name="attachments_hadoop_files_ids" type="any" title="attachments_hadoop_files_ids" /> <field name="source" type="integer" title="source" /> <field name="risk_level" type="integer" title="risk_level" /> <field name="review_update_date" type="datetime" title="review_update_date" /> <field name="employee_id" type="text" title="employee_id" /> <field name="attachments_hadoop_files_ids" type="text" title="attachments_hadoop_files_ids" /> </fields>
What i need is that the listgrid can sort/filter during data loading on the already provided data or on the DB table (which grows can grow to even 200k and larger sets records) the data should be paged to sets of 100 - 1k data sets, but the number of total records in grid summary should show the actuall size of the table.
I'm showing the number of records in the summary fields of one of the fields
Code:
subjectField.addSummaryFunction(new SummaryFunction() { @Override public Object getSummaryValue(Record[] records, ListGridField field) { return ""+records.length+" messages"; } });
How should I fetch the data?
Comment