BetaONE will rise again!


Reply
  #1  
Old 22nd Mar 04, 07:53 PM
SlickVic78's Avatar
SlickVic78 SlickVic78 is offline
Senior Member
 
Join Date: Sep 2001
Location: New York, USA
Posts: 515
SlickVic78 is an unknown quantity at this point
Hello All-

I noticed that my host recently updated their version of phpMyAdmin. Within Export, I see that there is now a new dropdown under the Data section named "Export Type". I assume the default was always set to "Insert", but having a better understanding what each one, "Insert", "Update", and "Replace", does would be very helpful.

Would someone please explain to me what each of these options does?

Also, when backing up my tables, I always used the option under the Data section "Extended Inserts". What is the difference between the options there: "Complete Inserts", "Extended Inserts", and now "Use Delayed Inserts"?

I have attached a snapshot as to what I am looking at here...

Many thanks!
-SlickVic78
__________________
  • Pentium 4 3.20GHz Processor
  • 1 Gig DDR 400MHz RAM
  • 100 Gig 7200 RPM Western Digital HDD
  • 80 Gig 7200 RPM Western Digital HDD
  • Lite-On LTR-52327S CD-RW Burner
  • Lite-On SOHW-1633S DVD Burner
  • ATI Radeon 9700 Pro
  • Sound Blaster Audigy
  • Microsoft Windows XP Pro SP-2
Reply With Quote
  #2  
Old 22nd Mar 04, 08:36 PM
war59312 war59312 is offline
BetaONE Supporter
 
Join Date: Jul 2001
Location: U.S.A
Posts: 2,220
war59312 has disabled reputation
Send a message via ICQ to war59312 Send a message via AIM to war59312 Send a message via MSN to war59312 Send a message via Yahoo to war59312
Click the doc. link to find out. lol

http://127.0.0.1/mysql/Documentation.html#faqexport



[6.12] I want to understand some Export options.
"Complete inserts" adds the column names on every INSERT command, for better documentation (but resulting file is bigger).
"Extended inserts" provides a shorter dump file by using only once the INSERT verb and the table name.
"Enclose table and field names with backquotes" ensures that field and table names formed with special characters are protected.
"Add AUTO_INCREMENT value" ensures, that AUTO_INCREMENT value (if any) will be included in backup.
"Add into comments" includes column comments, relations and MIME types set in the PMA-DB in the dump as SQL comments (/* xxx */).

That should answer your question.
__________________
Ad Muncher Usage Statistics for v4.7 Build 27105/1624
Adverts removed by Ad Muncher: 1,601,933
Approximate bandwidth saved: 12,515 MB
Counter started: April 2, 2003

Download: http://war59312.admuncher.com/download.shtml
Reply With Quote
  #3  
Old 22nd Mar 04, 08:55 PM
SlickVic78's Avatar
SlickVic78 SlickVic78 is offline
Senior Member
 
Join Date: Sep 2001
Location: New York, USA
Posts: 515
SlickVic78 is an unknown quantity at this point
Hey war59312,

Thanks for this info... This partially answers my second question in my previous post... What about "Use Delayed Inserts"?

Anyone have any info on the first part of my previous post?

Much thanks!
-SlicKVic78
__________________
  • Pentium 4 3.20GHz Processor
  • 1 Gig DDR 400MHz RAM
  • 100 Gig 7200 RPM Western Digital HDD
  • 80 Gig 7200 RPM Western Digital HDD
  • Lite-On LTR-52327S CD-RW Burner
  • Lite-On SOHW-1633S DVD Burner
  • ATI Radeon 9700 Pro
  • Sound Blaster Audigy
  • Microsoft Windows XP Pro SP-2
Reply With Quote
  #4  
Old 23rd Mar 04, 10:49 AM
JacKDynne's Avatar
JacKDynne JacKDynne is offline
Administrator
 
Join Date: Oct 2001
Location: The Past Through Tomorrow
Posts: 1,591
JacKDynne will become famous soon enoughJacKDynne will become famous soon enough
Send a message via MSN to JacKDynne

Quote:

The DELAYED option for the INSERT statement is a MySQL-specific option that is very useful if you have clients that can't wait for the INSERT to complete. This is a common problem when you use MySQL for logging and you also periodically run SELECT and UPDATE statements that take a long time to complete. DELAYED was introduced in MySQL Version 3.22.15. It is a MySQL extension to ANSI SQL92.

INSERT DELAYED only works with ISAM and MyISAM tables. Note that as MyISAM tables supports concurrent SELECT and INSERT, if there is no free blocks in the middle of the data file, you very seldom need to use INSERT DELAYED with MyISAM. See section MyISAM Tables.

When you use INSERT DELAYED, the client will get an OK at once and the row will be inserted when the table is not in use by any other thread.

Another major benefit of using INSERT DELAYED is that inserts from many clients are bundled together and written in one block. This is much faster than doing many separate inserts.

Note that currently the queued rows are only stored in memory until they are inserted into the table. This means that if you kill mysqld the hard way (kill -9) or if mysqld dies unexpectedly, any queued rows that weren't written to disk are lost!

The following describes in detail what happens when you use the DELAYED option to INSERT or REPLACE. In this description, the ``thread'' is the thread that received an INSERT DELAYED command and ``handler'' is the thread that handles all INSERT DELAYED statements for a particular table.

When a thread executes a DELAYED statement for a table, a handler thread is created to process all DELAYED statements for the table, if no such handler already exists.
The thread checks whether or not the handler has acquired a DELAYED lock already; if not, it tells the handler thread to do so. The DELAYED lock can be obtained even if other threads have a READ or WRITE lock on the table. However, the handler will wait for all ALTER TABLE locks or FLUSH TABLES to ensure that the table structure is up to date.
The thread executes the INSERT statement, but instead of writing the row to the table, it puts a copy of the final row into a queue that is managed by the handler thread. Any syntax errors are noticed by the thread and reported to the client program.
The client can't report the number of duplicates or the AUTO_INCREMENT value for the resulting row; it can't obtain them from the server, because the INSERT returns before the insert operation has been completed. If you use the C API, the mysql_info() function doesn't return anything meaningful, for the same reason.
The update log is updated by the handler thread when the row is inserted into the table. In case of multiple-row inserts, the update log is updated when the first row is inserted.
After every delayed_insert_limit rows are written, the handler checks whether or not any SELECT statements are still pending. If so, it allows these to execute before continuing.
When the handler has no more rows in its queue, the table is unlocked. If no new INSERT DELAYED commands are received within delayed_insert_timeout seconds, the handler terminates.
If more than delayed_queue_size rows are pending already in a specific handler queue, the thread requesting INSERT DELAYED waits until there is room in the queue. This is done to ensure that the mysqld server doesn't use all memory for the delayed memory queue.
The handler thread will show up in the MySQL process list with delayed_insert in the Command column. It will be killed if you execute a FLUSH TABLES command or kill it with KILL thread_id. However, it will first store all queued rows into the table before exiting. During this time it will not accept any new INSERT commands from another thread. If you execute an INSERT DELAYED command after this, a new handler thread will be created.
Note that the above means that INSERT DELAYED commands have higher priority than normal INSERT commands if there is an INSERT DELAYED handler already running! Other update commands will have to wait until the INSERT DELAYED queue is empty, someone kills the handler thread (with KILL thread_id), or someone executes FLUSH TABLES.
The following status variables provide information about INSERT DELAYED commands: Variable  Meaning 
Delayed_insert_threads  Number of handler threads 
Delayed_writes  Number of rows written with INSERT DELAYED 
Not_flushed_delayed_rows  Number of rows waiting to be written 
You can view these variables by issuing a SHOW STATUS statement or by executing a mysqladmin extended-status command.
Note that INSERT DELAYED is slower than a normal INSERT if the table is not in use. There is also the additional overhead for the server to handle a separate thread for each table on which you use INSERT DELAYED. This means that you should only use INSERT DELAYED when you are really sure you need it!
Hope that helps some

/JD
__________________


Reply With Quote
  #5  
Old 23rd Mar 04, 05:44 PM
SlickVic78's Avatar
SlickVic78 SlickVic78 is offline
Senior Member
 
Join Date: Sep 2001
Location: New York, USA
Posts: 515
SlickVic78 is an unknown quantity at this point
JacKDynne,

That helps out ALOT! A Delayed Insert can be useful if you have a very busy site where users are accessing the tables frequently... I guess as soon as no tables are being accessed within the DB, that is when the process kicks off to insert/update/replace the information within the specified tables. But the flaw is if MySQL gets killed in the process of the update, you lose that data that was not yet placed within the DB. Makes sense!

Thanks for the help. I pretty much assume I now know the roles of "Insert", "Update", and "Replace".

Insert - places infomation specifies within a new row within a table
Update - checks to see if rows are identicle, if not update the row with the new info
Replace - replace a row with new info

If I am wrong, someone please correct me.

Again, thanks for all your help in helping me understand all this DB jargon!

-SlickVic78
__________________
  • Pentium 4 3.20GHz Processor
  • 1 Gig DDR 400MHz RAM
  • 100 Gig 7200 RPM Western Digital HDD
  • 80 Gig 7200 RPM Western Digital HDD
  • Lite-On LTR-52327S CD-RW Burner
  • Lite-On SOHW-1633S DVD Burner
  • ATI Radeon 9700 Pro
  • Sound Blaster Audigy
  • Microsoft Windows XP Pro SP-2
Reply With Quote
  #6  
Old 23rd Mar 04, 07:00 PM
JacKDynne's Avatar
JacKDynne JacKDynne is offline
Administrator
 
Join Date: Oct 2001
Location: The Past Through Tomorrow
Posts: 1,591
JacKDynne will become famous soon enoughJacKDynne will become famous soon enough
Send a message via MSN to JacKDynne


/JD
__________________


Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:11 AM.


Design by Vjacheslav Trushkin for phpBBStyles.com.
Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.