Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 527195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:51:24+00:00 2026-05-13T08:51:24+00:00

Wow, makes your head spin! I am about to start a project, and although

  • 0

Wow, makes your head spin!

I am about to start a project, and although my mySql is OK, I can’t get my head around what required for this:

I have a table of web addresses.

id,url
1,http://www.url1.com
2,http://www.url2.com
3,http://www.url3.com
4,http://www.url4.com

I have a table of users.

id,name
1,fred bloggs
2,john bloggs
3,amy bloggs

I have a table of categories.

id,name
1,science
2,tech
3,adult
4,stackoverflow

I have a table of categories the user likes as numerical ref relating to the category unique ref. For example:

user,category
1,4
1,6
1,7
1,10
2,3
2,4
3,5
.
.
.

I have a table of scores relating to each website address. When a user visits one of these sites and says they like it, it’s stored like so:

url_ref,category
4,2
4,3
4,6
4,2
4,3
5,2
5,3
.
.
.

So based on the above data, URL 4 would score (in it’s own right) as follows: 2=2 3=2 6=1

What I was hoping to do was pick out a random URL from over 2,000,000 records based on the current users interests.

So if the logged in user likes categories 1,2,3 then I would like to ORDER BY a score generated based on their interest.

If the logged in user likes categories 2 3 and 6 then the total score would be 5. However, if the current logged in user only like categories 2 and 6, the URL score would be 3. So the order by would be in context of the logged in users interests.

Think of stumbleupon.

I was thinking of using a set of VIEWS to help with sub queries.

I’m guessing that all 2,000,000 records will need to be looked at and based on the id of the url it will look to see what scores it has based on each selected category of the current user.

So we need to know the user ID and this gets passed into the query as a constant from the start.

Ain’t got a clue!

Chris Denman

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T08:51:24+00:00Added an answer on May 13, 2026 at 8:51 am

    What I was hoping to do was pick out a random URL from over 2,000,000 records based on the current users interests.

    This screams for predictive modeling, something you probably wouldn’t be able to pull off in the database. Basically, you’d want to precalculate your score for a given interest (or more likely set of interests) / URL combination, and then query based on the precalculated values. You’d most likely be best off doing this in application code somewhere.

    Since you’re trying to guess whether a user will like or dislike a link based on what you know about them, Bayes seems like a good starting point (sorry for the wikipedia link, but without knowing your programming language this is probably the best place to start): Naive Bayes Classifier

    edit

    The basic idea here is that you continually run your precalculation process, and once you have enough data you can try to distill it to a simple formula that you can use in your query. As you collect more data, you continue to run the precalculation process and use the expanded results to refine your formula. This gets really interesting if you have the means to suggest a link, then find out whether the user liked it or not, as you can use this feedback loop really improve the prediction algorithm (have a read on machine learning, particularly genetic algorithms, for more on this)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.