Jump to content

Recommended Posts

I want to filter and match values that members have checked boxed. There's over 60 values possible from 20 fields that will be changing quite often. There will also be a simple calculation once each match is found. What would be the most efficient way to approach this task? If membership scales up a lot parsing these matches could take quite a bit of time.

 

Thanks

Al

Member "A" has check boxed values 1,4,5,6,9,45. Member "B" has check boxed values 2, 5.9, 31,36,50, 57. They match on 5 and 9. Member A & B would be in the same group based on the values 5 and 9 match, followed by a calculation on the relationship of the 5 the 9 values.  (member matches could be as high as 20, though, and constantly changing)

 

What I thought might work best is creating a cron job to continually update an index that would filter out member id's not matching on any values -- thus at least cutting down on the number of member comparisons/calculation needed. Any suggestion on getting more efficiency?

 

 

Yes, all values would be stored in db in corresponding fields. Memory VARs of values from Member "A" would be sent server side to compare with all other members 20 fields. Match filtering not a problem. BUT... if membership scales up into the millions the parsing (with an add'l calculation for each match) of each member's set of values against Member "A" could really slow things down. Any thoughts re cron job crawler to indexer? Or better architecture choices in mind?

I think MySQL's fast enough. It's not heavy querying.

 

I would have the table be:

id

user_id

value (just a number like you have it above)

 

Then have the SQL be

SELECT t1.value
FROM `table` t1
INNER JOIN `table` t2
    ON (t2.userid = '$member_two_id' AND t1.value = t2.value)
WHERE t1.userid = '$member_one_id';

 

SQL not tested.

Thanks, I see where you're going and you think mysql could parse quickly enough in the millions of members range? The INNER JOIN would have to be for any of the 20 fields being a match. Then there would need to be a loop to do a calculation  and INSERT. You feel all this would process pretty quick scaled up?

yes, timing not an issue for cron. So you think an indexer for this is the way to go?  I'd probably also want to have DATE () and TIME () inserted into "canvassing" table in order to skip over unchanged rows. Thanks for your help... any other suggestion hugely appreciated.

 

-Al

  • 3 weeks later...

I want to filter and match values that members have checked boxed. There's over 60 values possible from 20 fields that will be changing quite often. There will also be a simple calculation once each match is found. What would be the most efficient way to approach this task? If membership scales up a lot parsing these matches could take quite a bit of time.

 

Thanks

Al

 

That is a nice filter. There will also be a simple calculation once each match is found. But what would be the most efficient way to approach that task?

 

 

 

_________________

Aprilaire

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.