Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Other Databases (https://www.askmehelpdesk.com/forumdisplay.php?f=444)
-   -   If there are more fields in a table will it take more time to get search results (https://www.askmehelpdesk.com/showthread.php?t=278075)

  • Nov 7, 2008, 05:06 AM
    Idrees
    If there are more fields in a table will it take more time to get search results
    Hi.

    I want to make a database which'll have many tables. One of the table is USER. So I want to search username in User table. My question is if there are 3 fields in this table will it take less time to get search result of username as compared to if I've 30 fields in this table. Or you can say if there are less number of fields in a table then will it take less time to search any field from thousands of records. If this is so then is it a good idea to shif some of the fields of User table in any other table?:confused:
  • Nov 7, 2008, 07:42 AM
    JBeaucaire

    If UserName is a specific field, it won't matter how many other fields there are, they're not being searched. The search will operate as quickly as ever if you restrict the search to the single field UserName.
  • Nov 7, 2008, 07:46 AM
    ScottGem

    A lot depends on how you do your searches and how your database is designed.

    Generally fields that will be searched are indexed. Indexed fields will search faster that non indexed fields, regardless of the number of fields in the table.

    But keeping the number of fields down is a principle of relational database design. I suggest you read up on normalization.
  • Nov 10, 2008, 01:09 AM
    Idrees
    Quote:

    Originally Posted by ScottGem View Post
    A lot depends on how you do your searches and how your database is designed.

    Generally fields that will be searched are indexed. Indexed fields will search faster that non indexed fields, regardless of the number of fields in the table.

    But keeping the number of fields down is a principle of relational database design. I suggest you read up on normalization.

    But my question is that if there are 3 tables in a database and I've to search from the 1st table then if either size of the 1st table is big or small, will it change speed of search if the 1st table is small as compared to being big.
  • Nov 10, 2008, 06:32 AM
    ScottGem

    We answered that, The number of fields doesn't affect searches unless you are trying to do a full text search throughout the table. Otherwise searching is restricited to the field being requested in the search,

  • All times are GMT -7. The time now is 02:46 PM.