astralaaron Posted November 16, 2014 Share Posted November 16, 2014 If there is a table that has 10 fields, and you wanted to select only 2 of the fields, is it slower than if the table only had 2 fields and using a select *? I am wondering if I should have my members table have more fields or to create a separate table for their account profile information Link to comment Share on other sites More sharing options...
niche Posted November 16, 2014 Share Posted November 16, 2014 Searches are mostly about focus and the amount of data that has to be sifted. Target only the data that has the info you need in tables that don't contain a bunch of irrelevant data or data that requires a lot of calculation and your queries will usually be as fast as you can make them Link to comment Share on other sites More sharing options...
astralaaron Posted November 18, 2014 Author Share Posted November 18, 2014 Searches are mostly about focus and the amount of data that has to be sifted. Target only the data that has the info you need in tables that don't contain a bunch of irrelevant data or data that requires a lot of calculation and your queries will usually be as fast as you can make them Sorry, I have a difficult time wrapping my head around things some times.. When you say "tables that don't contain a bunch of irrelevant data" that means that the table with only the two fields would be faster than targeting the table that has 10 fields? The 8 additional fields are irrelevant to this specific search.. Thank you for responding. Link to comment Share on other sites More sharing options...
davej Posted November 18, 2014 Share Posted November 18, 2014 I doubt that the width of the table would have much effect as long as you aren't indexing these columns or pulling in a large amount of data. Obviously it is slower to handle more data vs. less data. Why don't you simply benchmark a pair of test cases? Link to comment Share on other sites More sharing options...
justsomeguy Posted November 18, 2014 Share Posted November 18, 2014 Indexes also play a role. If all of the columns that you're selecting are indexed in the order in which you select them then that will also affect the time to get results. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now