Sorting setting storage improvement ideas

4 views
Skip to first unread message

Alexander Obuhovich

unread,
Jul 5, 2011, 6:00:23 AM7/5/11
to In-Portal Development
In Admin Console In-Portal makes 4 requests to database during each list-style template display. For example on Phrases list such requests are made:

SELECT VariableValueVariableName
    FROM PersistantSessionData
    WHERE VariableName 'lang_Sort1.' AND PortalUserId = -1
    LIMIT 0,1

SELECT VariableValueVariableName
    FROM PersistantSessionData
    WHERE VariableName 
'lang_Sort1_Dir.' AND PortalUserId = -1
    LIMIT 0
,
1 

SELECT VariableValueVariableName
    FROM PersistantSessionData
    WHERE VariableName 
'lang_Sort2.' AND PortalUserId = -1
    LIMIT 0
,
1

SELECT VariableValueVariableName
    FROM PersistantSessionData
    WHERE VariableName 
'lang_Sort2_Dir.' AND PortalUserId = -1
    LIMIT 0
,
1

If we change sorting to be stored in one persistent session variable instead of 4, then we save 3 requests to database each time.


Phil -- wbtc.fr --

unread,
Jul 5, 2011, 6:11:01 AM7/5/11
to in-por...@googlegroups.com
I like request optimizations :)

2011/7/5 Alexander Obuhovich <aik....@gmail.com>

Alexander Obuhovich

unread,
Aug 8, 2011, 12:01:45 PM8/8/11
to in-por...@googlegroups.com
If we store all sorting like this: "FieldName1,order1;FieldName,order2....", then we could use same code to process them and "sort_by" tag parameter.

Dmitry, what's your opinion on this?

Dmitry A.

unread,
Aug 15, 2011, 12:20:19 AM8/15/11
to in-por...@googlegroups.com
Hi Alex,

Yes, I like and support your idea for improvement.

What's the amount of work is involved here?

DA

Alexander Obuhovich

unread,
Aug 15, 2011, 3:24:43 AM8/15/11
to in-por...@googlegroups.com
1.5 h work at most.

I've also noticed, that such 4 queries (to retrieve sorting settings) are performed for each list being displayed on front-end (links, categories and so on).

Dmitry A.

unread,
Aug 20, 2011, 5:29:48 PM8/20/11
to in-por...@googlegroups.com
Hi Alex,


Great. Please create a task for this.


DA

Alexander Obuhovich

unread,
Aug 24, 2011, 4:16:08 AM8/24/11
to in-por...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages