content_image/843868.jpg content_image/843869.jpg
<img src='content_image/843868.jpg'>

On Unix platforms, this variable is the name of the socket file that is used for local client connections. The default is /tmp/mysql.sock . (For some distribution formats, the directory might be different, such as /var/lib/mysql  for RPMs.) 

On Windows, this variable is the name of the named pipe that is used for local client connections. The default value is MySQL  (not case-sensitive). 

• sort_buffer_size 

<img src='content_image/843869.jpg'>

Each session that must perform a sort allocates a buffer of this size. sort_buffer_size  is not specific to any storage engine and applies in a general manner for optimization. At minimum the sort_buffer_size  value must be large enough to accommodate fifteen tuples in the sort buffer. Also, increasing the value of max_sort_length  may require increasing the value of sort_buffer_size . For more information, see Section 8.2.1.16, “ORDER BY Optimization” 

If you see many Sort_merge_passes  per second in SHOW GLOBAL STATUS  output, you can consider increasing the sort_buffer_size  value to speed up ORDER BY  or GROUP BY  operations that cannot be improved with query optimization or improved indexing. 

The optimizer tries to work out how much space is needed but can allocate more, up to the limit. Setting it larger than required globally slows down most queries that perform sorts. It is best to increase it as a session setting, and only for the sessions that need a larger size. On Linux, there are thresholds of 256KB and 2MB where larger values may significantly slow down memory allocation, so you should consider staying below one of those values. Experiment to find the best value for your workload. See Section B.3.3.5, “Where MySQL Stores Temporary Files” . 

The maximum permissible setting for sort_buffer_size  is 4GB − 1. Larger values are permitted for 64-bit platforms (except 64-bit Windows, for which large values are truncated to 4GB − 1 with a warning). 

