Author |
Topic |
SiSL
Average Member
Turkey
671 Posts |
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
|
OneWayMule
Dev. Team Member & Support Moderator
Austria
4969 Posts |
|
SiSL
Average Member
Turkey
671 Posts |
|
SiSL
Average Member
Turkey
671 Posts |
|
Podge
Support Moderator
Ireland
3775 Posts |
|
SiSL
Average Member
Turkey
671 Posts |
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
Posted - 24 September 2005 : 15:20:30
|
SiSL,
In your pop_profile.asp, around line# 399, here now you have,
strsql = "SELECT F.FORUM_ID"
strSql = strSql & ", T.TOPIC_ID"
strSql = strSql & ", T.T_SUBJECT"
strSql = strSql & ", T.T_STATUS"
strSql = strSql & ", T.T_LAST_POST"
strSql = strSql & ", T.T_REPLIES "
strSql = strSql & " FROM ((" & strTablePrefix & "FORUM F LEFT JOIN " & strTablePrefix & "TOPICS T"
strSql = strSql & " ON F.FORUM_ID = T.FORUM_ID) LEFT JOIN " & strTablePrefix & "REPLY R"
strSql = strSql & " ON T.TOPIC_ID = R.TOPIC_ID) "
strSql = strSql & " WHERE (T_DATE > '" & strStartDate & "') "
strSql = strSql & " AND (T.T_AUTHOR = " & ppMember_ID
strSql = strSql & " OR R.R_AUTHOR = " & ppMember_ID & ")"
strSql = strSql & " AND (T_STATUS < 2 OR R_STATUS < 2)"
strSql = strSql & " AND F.F_TYPE = 0"
strSql = strSql & " ORDER BY T.T_LAST_POST DESC, T.TOPIC_ID DESC"
replace it by
strsql = "SELECT F.FORUM_ID"
strSql = strSql & ", T.TOPIC_ID"
strSql = strSql & ", T.T_SUBJECT"
strSql = strSql & ", T.T_STATUS"
strSql = strSql & ", T.T_LAST_POST"
strSql = strSql & ", T.T_REPLIES "
strSql = strSql & " FROM (" & strTablePrefix & "FORUM F INNER JOIN " & strTablePrefix & "TOPICS T"
strSql = strSql & " ON F.FORUM_ID = T.FORUM_ID)"
strSql = strSql & " WHERE (T_DATE > '" & strStartDate & "') "
strSql = strSql & " AND (T.T_AUTHOR = " & ppMember_ID & ")"
strSql = strSql & " AND (T_STATUS < 2)"
strSql = strSql & " AND (T_REPLIES < 1) AND F.F_TYPE = 0"
strSql = strSql & " UNION"
strsql = strsql & " SELECT F.FORUM_ID"
strSql = strSql & ", T.TOPIC_ID"
strSql = strSql & ", T.T_SUBJECT"
strSql = strSql & ", T.T_STATUS"
strSql = strSql & ", T.T_LAST_POST"
strSql = strSql & ", T.T_REPLIES "
strSql = strSql & " FROM ((" & strTablePrefix & "FORUM F INNER JOIN " & strTablePrefix & "TOPICS T"
strSql = strSql & " ON F.FORUM_ID = T.FORUM_ID) INNER JOIN " & strTablePrefix & "REPLY R"
strSql = strSql & " ON T.TOPIC_ID = R.TOPIC_ID) "
strSql = strSql & " WHERE (T_DATE > '" & strStartDate & "') "
strSql = strSql & " AND (R.R_AUTHOR = " & ppMember_ID & ")"
strSql = strSql & " AND (T_STATUS < 2 OR R_STATUS < 2)"
strSql = strSql & " AND F.F_TYPE = 0"
strSql = strSql & " ORDER BY T.T_LAST_POST DESC, T.TOPIC_ID DESC"
Let me know if it improves on your problem.
P.S.:This code is good only for Access or SQL Server. MySQL versions that support UNIONS (4.0+) should also be ok, BUT NO TESTING WAS DONE.< |
Snitz 3.4 Readme | Like the support? Support Snitz too |
|
|
SiSL
Average Member
Turkey
671 Posts |
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
Posted - 24 September 2005 : 18:02:13
|
Can you compare both versions of the file (with and without the change) regarding the recent posts that appear for each user? I think they should be, but want to be sure...< |
Snitz 3.4 Readme | Like the support? Support Snitz too |
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
Posted - 24 September 2005 : 18:08:24
|
The difference in performance quite surely results from the fact that each topic must be evaluated against users permissions, to ensure that the user viewing the profile has access to the topics.
Using getrows instead of the navigating the recordset could also help improving the performance.< |
Snitz 3.4 Readme | Like the support? Support Snitz too |
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
|
SiSL
Average Member
Turkey
671 Posts |
|
modifichicci
Average Member
Italy
787 Posts |
Posted - 25 September 2005 : 02:55:53
|
P.S.:This code is good only for Access or SQL Server. MySQL versions that support UNIONS (4.0+) should also be ok, BUT NO TESTING WAS DONE.
Mysql 4.0.25 I get an error: Microsoft OLE DB Provider for ODBC Drivers error '80004005'
Unknown column 'T.TOPIC_ID' in 'ORDER BY'
/forumlang/test/pop_profile.asp, line 565
and this is the sqlstr SELECT F.FORUM_ID, T.TOPIC_ID, T.T_SUBJECT, T.T_STATUS, T.T_LAST_POST, T.T_REPLIES FROM (FORUM_FORUM F INNER JOIN FORUM_TOPICS T ON F.FORUM_ID = T.FORUM_ID) WHERE (T_DATE > '20050826090251') AND (T.T_AUTHOR = 2) AND (T_STATUS < 2) AND (T_REPLIES < 1) AND F.F_TYPE = 0 UNION SELECT F.FORUM_ID, T.TOPIC_ID, T.T_SUBJECT, T.T_STATUS, T.T_LAST_POST, T.T_REPLIES FROM ((FORUM_FORUM F INNER JOIN FORUM_TOPICS T ON F.FORUM_ID = T.FORUM_ID) INNER JOIN FORUM_REPLY R ON T.TOPIC_ID = R.TOPIC_ID) WHERE (T_DATE > '20050826090251') AND (R.R_AUTHOR = 2) AND (T_STATUS < 2 OR R_STATUS < 2) AND F.F_TYPE = 0 ORDER BY T.TOPIC_ID DESC < |
Ernia e Laparocele Forum di Ernia e Laparocele Acces - MySql Migration Tutorial Adamantine forum |
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
|
SiSL
Average Member
Turkey
671 Posts |
|
Topic |
|