Subject sort record size of 69708 bytes is too big
Author Si Carter
I am trying to run the following sql, which is part of a stored proc:

SELECT DISTINCT P.ID, P.USERID, U.USERNAME, P.MSG, P.POSTED,
P.LAST_EDITED,
P.LAST_EDITED_BY, U1.USERNAME, P.IPADDRESS, P.TOPICID, U.SHOW_SIG,
U.SIGNATURE
FROM DNFBB_POSTS P
LEFT JOIN DNFBB_TOPICS T ON (T.ID = P.TOPICID)
LEFT JOIN DNFBB_USERS U ON (U.ID = P.USERID)
LEFT JOIN DNFBB_USERS U1 ON (U1.ID = P.LAST_EDITED_BY)
LEFT JOIN DNFBB_FORUMS F ON (F.ID = T.FORUMID)
LEFT JOIN DNFBB_USERGROUPSTOFORUM UGUF ON (UGUF.FORUM_ID = F.ID)
LEFT JOIN DNFBB_USERTOUSERGROUPS UTUG ON (UTUG.USERGROUP_ID =
UGUF.USERGROUP_ID)
WHERE (P.TOPICID = 1) AND (UTUG.USER_ID = 1);

And if fails with error:

Message: isc_dsql_prepare failed

SQL Message : -904
Unsuccessful execution caused by an unavailable resource.

Engine Code : 335544758
Engine Message :
sort record size of 69708 bytes is too big


Without the DISTINCT everything is OK.

Does anybody have any ideas on how to solve it? I can provide a db script
if needed.

rgds

Si Carter
http://www.fbtalk.net/
http://sourceforge.net/projects/fbutils/
http://sourceforge.net/projects/dnfbb/