11/26/2024 5:25:45 AM
|
|
slxdeveloper.com Community Forums |
|
|
|
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
Forum to discuss usage & tips for SalesLogix controls and other 3rd party ActiveX controls. View the code of conduct for posting guidelines.
|
|
|
|
Speeding up data grid SORTING by Header Caption click
Posted: 07 Jan 10 8:30 PM
|
Any ideas on how these sorts are executed? RecordSet.SORT in memory as a bubble sort (remember writing a bubble sort in FORTRAN????).
2,000 + rows takes a LOONNNNGGGG time......how can we speed it up?
BTW we have sped up loading the grid by: 1. Using Native SQL Connections only 2. Use SQL to create a record set. 3. Set the grid record set to the created RS, that's a refresh.
Native SQL MUCH faster than SLX, primarily because we don't have to worry about joins to SECCODEID.
|
|
|
| |
|
Re: Speeding up data grid SORTING by Header Caption click
Posted: 08 Jan 10 7:52 AM
|
we had slow loading of attachment group after upgrading to 7.2
as i was explained SLX doesn't like blank id fields, so we run this to change all blanks to null loading time went from 4 minutes to 2 seconds
i run this against other tables with excellent results
update attachment set ticketid = null where ticketid = '' update attachment set opportunityid = null where opportunityid = '' update attachment set contactid = null where contactid = '' update attachment set contractid = null where contractid=’’ update accountproduct set serialnumber = null where serialnumber = '' update accountproduct set userfield4 = null where userfield4 = '' update accountproduct set location= null where location = '' update accountproduct set accountproductparentid = null where accountproductparentid= ''
|
|
|
|
Re: Speeding up data grid SORTING by Header Caption click
Posted: 08 Jan 10 10:25 AM
|
I would recommend you analyze (via SQL Profiler) how the queries are executed. I suspect that the Sort is being done on the Server, and depending on your analysis you may need to add additional indexes. |
|
|
|
Re: Speeding up data grid SORTING by Header Caption click
Posted: 08 Jan 10 1:43 PM
|
Had a talk with SLX today.....they said that the grid control object sort was the control's in memory/object sort and it was slooowww.....
So I added a button/drop down to the form to give the user some sort options.....when selected I do a recordset sort on my original recordset rs.SORT "ACCOUNT, MODIFYDATE DESC, A2_CITY,....."
and then set the grid to the recordset to refresh
SET gridname.RecordSet = RS
WOWZA, that was a big speed increase.....
If need be I could have gone back to the server and done an ORDER BY query...
Or use a Custom View......
The biggest speed increase was NOT using the SLX OLE DB Provider and the SLX Profiler.exe.....the joinSSS from ACCOUNT.SECCODEID to SECCODE slowed queries for 2000 records down from 160 ms to 5,200 ms....OUCH.
thanks for your help!
|
|
|
|
Answer is! Speeding up data grid SORTING by Header Caption click
Posted: 14 Jan 10 8:41 AM
|
1. use the grid's MouseDown event to trap user clicking on the sort captions (the On Column Sorted event is ex post facto, too late to prevent the grid control sort).
2. set Sortable to False (turns off SLX automagically doing their own sort on the captions on the Server (slow, you already have the data) through the SLX OLE DB Provider (slower).
3. do a record set sort myRS.SORT "Field1 ASC, Field3 DESC, etc."
4. refresh the grid with the sorted recordset Set grid.recordset = myRS
5. Set the caption glyph to zero (otherwise SLX will automagically do a recordset sort on ANY grid refresh, see #2)
6. set sortable to true (allows for correct user selection of multiple rows).
Took my boss 5 days of work and a few hundred lines of code.......the scarcity of documentation on the grid control is mind baffling.....(quick, what it the integer number for clicking on a Cell? Group? Row? Background (ok, it's 8).....)
Eventually I'll post it up here as a solution....needless to say the sorting speed improvement is EXPONENTIAL! |
|
|
|
You can
subscribe to receive a daily forum digest in your
user profile. View the site code
of conduct for posting guidelines.
Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
|
|
|
|
|
|
|
|