By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,265 Members | 1,333 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,265 IT Pros & Developers. It's quick & easy.

speeding up inserts

P: n/a
according to the mysql manual, multiple inserts can be sped up by
locking the table before doing them and unlocking the table afterwards.

is the same true of multiple inserts in mysql? if so, how would the
table be locked?

any insights would be appreciated - thanks!

Mar 29 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
ze*****@gmail.com wrote:
according to the mysql manual, multiple inserts can be sped up by
locking the table before doing them and unlocking the table afterwards.

is the same true of multiple inserts in mysql? if so, how would the
table be locked?

any insights would be appreciated - thanks!


Um, this is a newsgroup dedicated to Microsoft SQL Server. You're
probably better off checking in news:comp.databases.mysql .

Cheers

robert

Mar 29 '06 #2

P: n/a
(ze*****@gmail.com) writes:
according to the mysql manual, multiple inserts can be sped up by
locking the table before doing them and unlocking the table afterwards.

is the same true of multiple inserts in mysql? if so, how would the
table be locked?

any insights would be appreciated - thanks!


In case "mysql" in the second paragraph is a type for MS SQL Server, the
answer is that you cannot really lock a table as such in MS SQL Server,
and definitely not unlock it. You can specify a locking hint to get a
table lock when you insert the first row. Note that you need to have a
user-defined transaction in progress, or else the lock will be released
since statements auto-commit in SQL Server. To "unlock" you simply commit
the transaction.

However, normally you don't play these games for insert statments. It's
better to let SQL Srever choose the locking mode.

If you need to load lots of data, you use BCP (a command-line tool) or
BULK INSERT (an SQL Statement). With these you can specify table lock to
speed up the operation.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Mar 29 '06 #3

P: n/a

Robert Klemme wrote:
ze*****@gmail.com wrote:
according to the mysql manual, multiple inserts can be sped up by
locking the table before doing them and unlocking the table afterwards.

is the same true of multiple inserts in mysql? if so, how would the
table be locked?

any insights would be appreciated - thanks!


Um, this is a newsgroup dedicated to Microsoft SQL Server. You're
probably better off checking in news:comp.databases.mysql .


err... sorry. I should have said mssql in the second paragraph. i'm
more familiar with mysql, hence my example in the first paragraph.
unfortunately, i'm not sure how to translate this to mssql, hence the
second paragraph.

also, why would i quote the manual of some dbms and then ask if "the
same" is true of that dbms?

bleh.

Mar 29 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.