C# SQL connector very slow

Started by
17 comments, last by Washu 11 years, 11 months ago
For a bulk query, turn off auto transactions and wrap the entire query in a single transaction (how you turn them off depends on your SQL engine).

Indexes don't magically make things faster, they improve performance on queries that involve lookups based on the indexed column, at the cost of additional time spent during inserts, deletes, and some updates (ones that involve the indexed column[s]). A select query does not depend on indexes, that is up to the query analyzer (in your prefered SQL server engine) to determine if there are any relevant indexes and to use them. I would highly recommend you get a book on the basics of SQL.

A basic data-structures course would also get you on track with sufficient knowledge to at least understand (to some degree) the underlying data-structures behind tables and indexes.

If you're familiar with data-structures, then I would highly recommend a book like T-SQL Querying. While it is specific to Microsoft SQL-Server, the coverage of the underlying mechanisms for clustered tables, non-clustered tables, and indexing is sufficient to give you a good idea of how most SQL engines work.

In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.

Advertisement

If you're familiar with data-structures, then I would highly recommend a book like T-SQL Querying. While it is specific to Microsoft SQL-Server, the coverage of the underlying mechanisms for clustered tables, non-clustered tables, and indexing is sufficient to give you a good idea of how most SQL engines work.


Honestly I have large gaps in my knowledge since I don't do this professionally, just as a hobby. (The first step is admitting you have a problem right? hah)
I am using mysql right now.
For $30 and the prospect of continuing to work with SQL I will give it a read, thank you =), I am also going to order a more basic SQL book so I can work my knowledge up from the ground up with a better foundation than I currently have.

For each record I am doing a select to find the reference ID for the line in the table.


nooooooooooooooo! bnoooooooooooooooooooo!
man. you get imposible amount of results and you perform update from those results? it takes second? what machine have you got?
Use JOIN to get all neede rows and then

why not?
[source]
UPDATE row IN tableofmine WHERE conditionismet SET "myvaluesextraction"
[/source]
also, if you want to update ten records you need not to call ten updates just call one update with propriate condition, but the values must match. if they do not, you need to perform multiple updates
but this happens only at databases migrations, not regular web applications continuing
SQL server is a poor boy who can not be balanced ! when you query SQL boy... please. ..... form your question so that he provides you with all data you can possibly need and you then request them on order you have specified. This is a powerfull feature . So, get result just, do not get it so fast.
Please don't post four times in a row in the same thread. If you have something to add to a post, use the Edit button.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]


Please don't post four times in a row in the same thread. If you have something to add to a post, use the Edit button.


Right. I understand. But doens it keep nice schedule of post?......but I see your point

[quote name='ApochPiQ' timestamp='1337904024' post='4943060']
Please don't post four times in a row in the same thread. If you have something to add to a post, use the Edit button.


Right. I understand. But doens it keep nice schedule of post?......but I see your point
[/quote]
Your first three posts have a total of 5 minutes between them. That's edit time. Your last post is 18 minutes later, and (had you edited the first post) would have been fine.

As an additional note, your last post appears to be generally unreadable.

In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.

This topic is closed to new replies.

Advertisement