[TYPO3-mvc] query for match two users of same usergroup

Patrick Schriner pschriner at gmx.de
Thu Jan 31 15:17:03 CET 2013


Hi Dominic,

I share you fear about the number of user entries, and have given some  
thought to your problem.

I'm pretty sure (especially since MySQL really doesn't handle those lists  
well) that the best approach would be to retrieve all distinct (uid,  
usergroup) from fe_users that are referenced in any from or to fields of  
your mail entries. At best, that is a lot less than the total number of  
users, at worst, it's the same.

Than I'd iterate once through the whole array and build a map where I'd  
use the "sorted" usergroup fields as a key and the found uids as values.

At last you'd have to iterate once again over that array and find any  
entries with > 1 uid assigned.

I haven't tried but I'm pretty sure that this is faster than making a lot  
of complex querries.

Patrick

On Thu, 31 Jan 2013 01:35:44 +0100, Domi <djgarms at gmail.com> wrote:

> Hi Toke
>> Tx_Extbase_Domain_Model_FrontendUser
>>    - usergroup
>>      - Tx_Extbase_Domain_Model_FrontendUsergroup:1
>>      - Tx_Extbase_Domain_Model_FrontendUsergroup:2
>>      ...
>>
>> using the array iterators you can create a query based on the
>> user->getUsergroup()
>
> Yes I know that I can iterate through all my emails and archive the  
> values through PHP functions, but I would like to know if this task is  
> possible with pure SQL statement to avoid heavy traffic. There might be  
> thousands of mailentries and to iterate each entry and test the  
> usergroup of each from / to user seems for me a bit unefficient.
>
> Cheers Dominic


More information about the TYPO3-project-typo3v4mvc mailing list