SQL query size - is it important?

I have a sql query (MyQSL DB using .Net SqlClient) that returns a dataset. If the dataset is 4,000 rows or 20, is there a significant difference in runtime?
In addition, how much time the request took to open the connection, etc. Compared to the time it takes to populate the results table?

Thank.

Explanation (change):
Each of the 4000 lines represents a folder name. I want to filter them so that users do not have to see them all, except for those that are interesting to them.
I'm not sure which is better: Filtering to get names from the database (this is on another computer), which can make my query more complex or just filter the view (the tree that the user sees). These 4,000 lines can turn into 40,000, but I'm not sure if this will be relevant for this problem. Thanks again.

Editing again: the
database is online, but the connection is pretty fast, say 100 Mbps.

+3
source share
5 answers

, . 4000 200 20 - , , .

: , , .

+1

, , , , . , , - thosands, , . , .

0

. - . ( ) . , , . , 4000 , 20 ..

. , 4000 40.000.

0

. 200- -, ? , db db, . . .

, , .

0

-, -, .

, , , .

And then, if your table is such that the first 20 suitable rows can be quickly found, and the 21st row appears only after a long scanning process, then limiting the result to 20 rows will give much faster results.

What you need to do is profile your setup. This is the only way to make sure.

0
source

Source: https://habr.com/ru/post/1771673/


All Articles