sql - What's the curve for a simple select query? -


this conceptual question.

hypothetically, when select * table_name table has 1 million records takes 3 secs.

similarly, when select 10 million records time taken 30 secs. told selection of records not linearly proportional time. after number, time required select records increases exponentially?

please me understand how works?

there things can make 1 query take longer other simple selects no clauses or joins.

first, time return query depends on how busy network @ time query run. depend on whether there locks on data or how memory available.

it depends on how wide tables , in general how many bytes individual record have. instance expect 10 million record table has 2 columns both ints return faster million record table has 50 columns including large columns epecially if things documents stored database objects or large fields have text fit ordinary varchar or nvarchar field (in sql server these nvarchar(max) or text instance). expect becasue there less total data return though more records.

as start adding clauses , joins of course there many more things affect performance of indivuidual query. if query datbases, should read book on performance tuning particular database. there many things can without realizing can cause queries run more need be. should learn techniques create queries performant.


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -