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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:59:19+00:00 2026-06-05T05:59:19+00:00

Say you have a query like SELECT t1.c1, t2.c2, … more fields from joins

  • 0

Say you have a query like

SELECT
    t1.c1,
    t2.c2,
    ... more fields from joins ...
FROM t1
LEFT JOIN t2 ON t1.id = t2.id
... more joins ...
GROUP BY t1.field
WHERE ...

And you’re having performance problems and you think you’ve covered all the common optimizations for this type of query, like defining indexes on the columns in your ON, GROUP BY, WHERE etc.. but it’s still really slow.

  • 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-06-05T05:59:20+00:00Added an answer on June 5, 2026 at 5:59 am

    Check that all of your joins are to actual tables and not views!

    I know this is rather stating the obvious, but it stumped be for a while because I has just forgotten that one of the joins was to a view.

    This is a question that I didn’t get round to asking before I found the answer myself, but I wanted to post to help anyone else with the same issue as it wasn’t mentioned in any of the other posts about optimizing GROUP BY queries with JOINs. I’m not sure if this is accepted on SO, but I have also added to the accepted answer on this post, so I won’t be offended if the administrators want to delete this post.

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

Sidebar

Related Questions

Say, you have a query like SELECT COUNT(*), date FROM ORDERS GROUP BY date
So lets say i have a query like this SELECT a as d,b,c FROM
Let's say I have something like this: $db=new PDO($dsn); $statement=$db->query('Select * from foo'); while
Say I have a query like the following: SELECT * FROM users WHERE username
Say I have a table which I query like so: select date, value from
Let's say I have a query like this: SELECT * FROM table_name WHERE venue
Let us say I have a query like this: SELECT * FROM ( SELECT
Say I have a query like this: SELECT * FROM my_table WHERE name =
Say I have a simple query like this: SELECT * FROM topics ORDER BY
Say I have a query like the one below: SELECT t1.id, t1.Name FROM Table1

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.