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 880287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T12:04:23+00:00 2026-05-15T12:04:23+00:00

I need some help optimizing queries on 2 tables. One will contain about a

  • 0

I need some help optimizing queries on 2 tables. One will contain about a million and the other will contain about 10 million of rows.

here is the table structure —

Table Structure

Sample Browse and Search Queries

These queries takes a very long time, about 15-20 secs, in some cases over a minute

So, please have a look and suggest me how can i make them much faster for practical use.

P.S. here are the query plans for those 2 sample search and browse queries …

Explain: search query

Explain: Browse query

  • 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-15T12:04:24+00:00Added an answer on May 15, 2026 at 12:04 pm

    You might want to put indexes on the fields you’re filtering on, like category_id, site_enabled, and video_collection date.

    In general, with tables of that size, the goal is to cut down as much as possible on the number of rows that need to be joined.

    For your browse query, I can only imagine it being that slow if it’s trying to join all of the rows and then filter the results down to 20. You might try re-writing it to use a nested select on the top 20 vids with the most likes. Something like:

    select 
    v.video_id,
    v.video_title,
    v.video_link,
    v.video_total_view,
    v.video_likes_count,
    v.video_collection_date as date,
    v.video_time,
    s.site_name
    
    from 
    (select 
    video_id,
    v.video_title,
    v.video_link,
    v.video_total_view,
    v.video_likes_count,
    v.video_collection_date as date,
    v.video_time
    from icumm_videos 
    where category_id='1'
    and 1277612659 - v.video_collection_date < 86400 * 7
    order by video_likes_count desc limit 0,20) v
    inner join icumm_sites s on v.site_id = s.site_id and site_enabled>0
    left outer join icumm_featured_videos fv on v.video_id = fv.video_id
    

    I couldn’t see where your query was using anything from the featured videos table, so that join may be superfluous.

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

Sidebar

Ask A Question

Stats

  • Questions 457k
  • Answers 457k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Pass something greater than zero for gluPerspective()'s zNear: gluPerspective(90, 1,… May 15, 2026 at 10:40 pm
  • Editorial Team
    Editorial Team added an answer You can use a non-owning (or "weak") reference, similar to… May 15, 2026 at 10:40 pm
  • Editorial Team
    Editorial Team added an answer You can remove unnecessary connectors - for example, I removed… May 15, 2026 at 10:40 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.