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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T01:44:05+00:00 2026-06-14T01:44:05+00:00

My tables: big_table +—————–+————–+——+—–+———+—————-+ | Field | Type | Null | Key | Default

  • 0

My tables: big_table

+-----------------+--------------+------+-----+---------+----------------+
| Field           | Type         | Null | Key | Default | Extra          |
+-----------------+--------------+------+-----+---------+----------------+
| id              | mediumint(7) | NO   | PRI | NULL    | auto_increment |
| title           | varchar(255) | NO   |     | NULL    |                |
| category_id     | tinyint(2)   | NO   |     | NULL    |                |
| sub_category_id | tinyint(2)   | NO   |     | NULL    |                |
| width           | smallint(5)  | NO   |     | NULL    |                |
| height          | smallint(5)  | NO   |     | NULL    |                |
| ratio_width     | smallint(5)  | NO   |     | NULL    |                |
| ratio_height    | smallint(5)  | NO   |     | NULL    |                |
| size            | int(8)       | NO   |     | NULL    |                |
| mime            | tinyint(2)   | NO   |     | NULL    |                |
| views           | mediumint(7) | NO   | MUL | NULL    |                |
| time            | int(10)      | NO   |     | NULL    |                |
| file            | varchar(255) | NO   |     | NULL    |                |
+-----------------+--------------+------+-----+---------+----------------+

small_table

+--------+--------------+------+-----+---------+-------+
| Field  | Type         | Null | Key | Default | Extra |
+--------+--------------+------+-----+---------+-------+
| id     | mediumint(7) | NO   | PRI | NULL    |       |
| width  | smallint(5)  | NO   | MUL | NULL    |       |
| height | smallint(5)  | NO   | MUL | NULL    |       |
+--------+--------------+------+-----+---------+-------+

so what’s faster (example):

   SELECT * FROM `big_table` WHERE `width` =1920 AND `height`=1080;  

or use join

 select big_table.*
 from small_table
 left join small_table small_table2
 ON (small_table.id=small_table2.id
     and `small_table`.`height` = '1080')
 left join big_table
 ON (big_table.id=small_table.id)
 where small_table.width = '1920'; 

or join’s from the same table?

select big_table.*
from big_table as big_table1
left join big_table big_table2
ON (big_table1.id=big_table2.id and  `big_table1`.`height` = '1080')
left join big_table 
ON (big_table.id=big_table1.id)
where big_table1.width = '1920';

or there is some better solution, better select’s?
(on both tables I can use indexes (width and height), but only ID is unique)

  • 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-14T01:44:06+00:00Added an answer on June 14, 2026 at 1:44 am

    No join is faster that join. If you have a proper index (that is, a single index on the combination of width and height) then the simple select on big_table will be way faster.

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

Sidebar

Related Questions

When you join tables which are distributed on the same key and used these
I have SQL Server 2008 Ent and OLTP database with two big tables. How
I have a MySQL table which has a product_id field (big integer) 1102330008 1102330025
I have two tables. There are users informations from two sites: p_users p_users2 There
I have 2 databases and I need to link information between two big tables
I've got a table big_table , with 4 million record, they are clustered in
I have two somewhat big (4+ million records) tables with identical structure, and they
I have two tables: Table 1 has Episode and Code, with Episode as distinct.
I am using MyISAM only database and an update on a big tables is
I have a schema with many related tables. A view let me agglomerate all

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.