<< previous page   --   table of contents   --   next page >>
| | | | | | | |
  • Return to Table of Contents
  • Table of Contents

    1. General Information
    2. MySQL Installation
    3. Tutorial Introduction
    4. Database Administration
    5. MySQL Optimisation
    6. MySQL Language Reference
    7. MySQL Table Types
    8. MySQL APIs
    9. Extending MySQL

    Chapter 5:  MySQL Optimisation 367 The MySQL-Linux distribution provided by MySQL AB used to be compiled with pgcc, but we had to go back to regular gcc because of a bug in pgcc that would generate the code that does not run on AMD. We will continue using gcc until that bug is resolved.  In the meantime, if you have a non-AMD machine, you can get a faster binary by compiling with pgcc.  The standard MySQL Linux binary is linked statically to get it faster and more portable. 5.5.4  How MySQL Uses Memory The following list indicates some of the ways that the mysqld server uses memory.  Where applicable, the name of the server variable relevant to the memory use is given:    The key bu er (variable key_buffer_size) is shared by all threads; other bu ers used by the server are allocated as needed.  See Section 5.5.2 [Server parameters], page 363.    Each  connection  uses  some  thread-speci c  space:   A  stack  (default  64K,  variable thread_stack),  a  connection  bu er  (variable  net_buffer_length),  and  a  result bu er  (variable  net_buffer_length).   The  connection  bu er  and  result  bu er  are dynamically  enlarged  up  to  max_allowed_packet  when  needed.   When  a  query  is running, a copy of the current query string is also allocated.    All threads share the same base memory.    Only the compressed ISAM / MyISAM tables are memory mapped. This is because the 32-bit memory space of 4GB is not large enough for most big tables.  When systems with  a  64-bit  address  space  become  more  common  we  may  add  general  support  for memory mapping.    Each  request  doing  a  sequential  scan  over  a  table  allocates  a  read  bu er  (variable record_buffer).    When reading rows in 'random' order (for example after a sort) a random-read bu er is allocated to avoid disk seeks.  (variable record_rnd_buffer).    All joins are done in one pass, and most joins can be done without even using a tem- porary table.  Most temporary tables are memory-based (HEAP) tables.  Temporary tables with a big record length (calculated as the sum of all column lengths) or that contain BLOB columns are stored on disk. One problem in MySQL versions before Version 3.23.2 is that if a HEAP table exceeds the size of tmp_table_size, you get the error The table tbl_name is full.  In newer versions  this  is  handled  by  automatically  changing  the  in-memory  (HEAP)  table  to a  disk-based  (MyISAM)  table  as  necessary.   To  work  around  this  problem,  you  can increase  the  temporary  table  size  by  setting  the  tmp_table_size  option  to  mysqld, or  by  setting  the  SQL  option  BIG_TABLES  in  the  client  program.   See  Section  5.5.6 [SET],  page 369.  In MySQL Version 3.20,  the maximum size of the temporary table was record_buffer*16, so if you are using this version, you have to increase the value of record_buffer.  You can also start mysqld with the --big-tables option to always store temporary tables on disk. However, this will a ect the speed of many complicated queries.    Most requests doing a sort allocates a sort bu er and 0-2 temporary les depending on the result set size.  See Section A.4.4 [Temporary les], page 643.
     

    Customer Support CentreMySQL Reference Manual

    Web Hosting Services
    UNIX WEB HOSTING
    SUPPORT & FAQ's
    TERMS OF USE
    Domain Services
    DOMAIN REGISTRATION
    MANAGE YOUR ACCOUNT
    SUPPORT & FAQ's
    TERMS OF USE
    SITE MAP
    Home
    Hosting Plans | Domain Registration | About Us | Contact Us | Site Map
    Terms of Use | Privacy Policy | Guarantees
    Merchant Accounts

    SpiritHost - web hosting for spiritual and education sites
    SpiritHit.com - Religious and Spiritual Portal
  • Return to Table of Contents
  • Back to top

  • Web Hosting: Manuals & FAQ's

    1. Unix-Based Web Hosting
    2. Unix Dedicated Servers
    3. Windows Dedicated Servers
    4. CuteFTP User’s Guide
    5. CuteHTML User’s Guide
    6. WS_FTP Pro User's Guide
    7. Miva Order User's Guide
    8. Miva Merchant User's Guide