QUOTE(narf03 @ Nov 14 2023, 09:10 PM)
I have a .net app that connect to SQL server machine using gigabit lan, both pc running on the same gb lan switich, tested no problem copying huge file. almost max out gb connection.
by slow mean, it connect to sql server get like 10k rows of data consists of ~30 columns, and put up to datagridview, takes about 10 seconds to complete.
if i run the app directly in the sql server machine, the exact same operation take less than 1 second.
both pc are i7 or better, no 32G ram, nothing in the background hogging any resource.
I wonder if there are anything limiting the speed of data transfer or displaying data i need to be aware of ?
Gut feeling is that you're grabbing the rows one by one, necessitating a network round trip per row. Fetch all of them in one shot, not row by row.by slow mean, it connect to sql server get like 10k rows of data consists of ~30 columns, and put up to datagridview, takes about 10 seconds to complete.
if i run the app directly in the sql server machine, the exact same operation take less than 1 second.
both pc are i7 or better, no 32G ram, nothing in the background hogging any resource.
I wonder if there are anything limiting the speed of data transfer or displaying data i need to be aware of ?
Don't know .net or SQL Server enough, but for Go and PostgreSQL, there's this concept of "single round trip query mode": https://pkg.go.dev/github.com/jackc/pgx/v5#QueryExecMode
to slurp all results at once.
A little more of a leap, but understanding this: https://colin-scott.github.io/personal_webs...ve_latency.html and the implications allows you to visualize performance bottlenecks better.
e.g. in your case, doing best case, one network round trip might be about 0.5ms. 10k rows = 5 seconds already spent sending and waiting for network, at least. It's not about bandwidth. It's about latency.
This post has been edited by angch: Nov 15 2023, 09:39 AM
Nov 15 2023, 09:34 AM

Quote
0.0195sec
1.90
6 queries
GZIP Disabled