Drop Table

Support Forum for database administrators and web based access to important newsgroups related to databases
Register on Database Support Forum Edit your profileCalendarFind other Database Support forum membersFrequently Asked QuestionsSearch this forum -> 
For Database admins: Free Database-related Magazines Now Free shipping to Texas


Post New Thread










Thread
Author

speeding up inserts
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!


Report this thread to moderator Post Follow-up to this message
Old Post
zelnaga@gmail.com
03-29-06 02:28 PM


Re: speeding up inserts
zelnaga@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


Report this thread to moderator Post Follow-up to this message
Old Post
Robert Klemme
03-29-06 04:28 PM


Re: speeding up inserts
(zelnaga@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, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

Report this thread to moderator Post Follow-up to this message
Old Post
Erland Sommarskog
03-30-06 01:26 AM


Re: speeding up inserts
Robert Klemme  wrote:
> zelnaga@gmail.com wrote: 
>
> 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.


Report this thread to moderator Post Follow-up to this message
Old Post
zelnaga@gmail.com
03-30-06 01:26 AM


Sponsored Links





Last Thread Next Thread
Post New Thread

Microsoft SQL Server forum archive

Show a Printable Version Email This Page to Someone! Receive updates to this thread
Microsoft SQL Server
Access database support
PostgreSQL Replication
SQL Server ODBC
FoxPro Support
PostgreSQL pgAdmin
SQL Server Clustering
MySQL ODBC
Web Applications with dBASE
SQL Server CE
MySQL++
Sybase Database Support
MS SQL Full Text Search
PostgreSQL Administration
SQL Anywhere support
DB2 UDB Database
Paradox Database Support
Filemaker Database
Berkley DB
SQL 2000/2000i database
ASE Database
Forum Jump:
All times are GMT. The time now is 08:03 PM.

 
Mobile devices forum | Database support forum archive




Copyrights DropTable.com Database Support Forum 2004 - 2006