summaryrefslogtreecommitdiff
path: root/Docs
diff options
context:
space:
mode:
authorunknown <monty@donna.mysql.com>2000-09-26 02:59:26 +0300
committerunknown <monty@donna.mysql.com>2000-09-26 02:59:26 +0300
commitf0c7c8384123639570f2bc61b7e2c806a386e780 (patch)
tree0a9d1cee77edbf3d7c1668fa7ffe3970124bed0c /Docs
parent2fdf8e6b7e06390036f40e11b3e334cf131d6b7a (diff)
parent48e80bd5ec3e633b30640e54ae4315915c21559a (diff)
downloadmariadb-git-f0c7c8384123639570f2bc61b7e2c806a386e780.tar.gz
merge
BitKeeper/etc/logging_ok: Auto merged Docs/manual.texi: Merge
Diffstat (limited to 'Docs')
-rw-r--r--Docs/manual.texi104
1 files changed, 82 insertions, 22 deletions
diff --git a/Docs/manual.texi b/Docs/manual.texi
index 12091a45252..19e38188467 100644
--- a/Docs/manual.texi
+++ b/Docs/manual.texi
@@ -581,7 +581,7 @@ Speed of queries that access or update data
* Estimating performance:: Estimating query performance
* SELECT speed:: Speed of @code{SELECT} queries
* Where optimizations:: How MySQL optimizes @code{WHERE} clauses
-* LEFT JOIN optimization:: How MySQL optimizes @code{LEFT JOIN}
+* LEFT JOIN optimization:: How MySQL optimizes @code{LEFT JOIN} and @code{RIGHT JOIN}
* LIMIT optimization:: How MySQL optimizes @code{LIMIT}
* Insert speed:: Speed of @code{INSERT} queries
* Update speed:: Speed of @code{UPDATE} queries
@@ -9056,7 +9056,7 @@ almost always sorted. In 3.23, you must use @code{GROUP BY} or
@code{SUM()} now returns @code{NULL}, instead of 0, if there is no matching
rows. This is according to ANSI SQL.
@item
-New restricted words: @code{CASE, THEN, WHEN, ELSE and END}
+New restricted words: @code{CASE, THEN, WHEN, ELSE, END and RIGHT}
@item An @code{AND} or @code{OR} with @code{NULL} values will now return
@code{NULL} instead of 0. This mostly affects queries that uses @code{NOT}
on an @code{AND/OR} expression as @code{NOT NULL} = @code{NULL}.
@@ -16511,10 +16511,22 @@ DROP DATABASE [IF EXISTS] db_name
@code{DROP DATABASE} drops all tables in the database and deletes the
database. @strong{Be VERY careful with this command!}
-@code{DROP DATABASE} returns the number of files that were removed from the
-database directory. Normally, this is three times the number of tables,
-because each table corresponds to a @file{.MYD} file, a @file{.MYI} file and a
-@file{.frm} file.
+@code{DROP DATABASE} returns the number of files that were removed from
+the database directory. Normally, this is three times the number of
+tables, because normally each table corresponds to a @file{.MYD} file, a
+@file{.MYI} file and a @file{.frm} file.
+
+The @code{DROP DATABASE} command removes from the given database
+directory all files with the following extensions:
+
+@multitable @columnfractions .25 .25 .25 .25
+@item .BAK @tab .DAT @tab .HSH @tab .ISD
+@item .ISM @tab .ISM @tab .MRG @tab .MYD
+@item .MYI @tab .db @tab .frm
+@end multitable
+
+All sub directories that consists of 2 digits (@code{RAID} directories)
+are also removed.
In @strong{MySQL} 3.22 or later, you can use the keywords @code{IF EXISTS} to
prevent an error from occurring if the database doesn't exist.
@@ -17719,6 +17731,10 @@ store a blob in a file.
@findex LEFT OUTER JOIN
@findex NATURAL LEFT JOIN
@findex NATURAL LEFT OUTER JOIN
+@findex RIGHT JOIN
+@findex RIGHT OUTER JOIN
+@findex NATURAL RIGHT JOIN
+@findex NATURAL RIGHT OUTER JOIN
@findex STRAIGHT_JOIN
@node JOIN, INSERT, SELECT, Reference
@section @code{JOIN} syntax
@@ -17735,6 +17751,9 @@ table_reference LEFT [OUTER] JOIN table_reference join_condition
table_reference LEFT [OUTER] JOIN table_reference
table_reference NATURAL [LEFT [OUTER]] JOIN table_reference
@{ oj table_reference LEFT OUTER JOIN table_reference ON conditional_expr @}
+table_reference RIGHT [OUTER] JOIN table_reference join_condition
+table_reference RIGHT [OUTER] JOIN table_reference
+table_reference NATURAL [RIGHT [OUTER]] JOIN table_reference
@end example
Where @code{table_reference} is defined as
@@ -17791,7 +17810,7 @@ mysql> select table1.* from table1
This example finds all rows in @code{table1} with an @code{id} value that is
not present in @code{table2} (i.e., all rows in @code{table1} with no
corresponding row in @code{table2}). This assumes that @code{table2.id} is
-declared @code{NOT NULL}, of course.
+declared @code{NOT NULL}, of course. @xref{LEFT JOIN optimization}.
@item
The @code{USING} @code{(column_list)} clause names a list of columns that must
@@ -17815,6 +17834,11 @@ with a @code{USING} clause that names all columns that exist in both
tables.
@item
+@code{RIGHT JOIN} works analogously as @code{LEFT JOIN}. To keep code
+portable across databases, it's recommended to use @code{LEFT JOIN}
+instead of @code{RIGHT JOIN}.
+
+@item
@code{STRAIGHT_JOIN} is identical to @code{JOIN}, except that the left table
is always read before the right table. This can be used for those (few)
cases where the join optimizer puts the tables in the wrong order.
@@ -18158,9 +18182,11 @@ files directly, because the contents of the file must travel from the client
host to the server host. On the other hand, you do not need the
@strong{file} privilege to load local files.
-Note that you can't read from a FIFO with @code{LOAD DATA INFILE}; If
-you need to read from a FIFO (for example the output from gunzip), use
-@code{LOAD DATA LOCAL INFILE} instead.
+@c old version
+If you are using @strong{MySQL} before 3.23.24 you can't read from a
+FIFO with @code{LOAD DATA INFILE}; If you need to read from a FIFO (for
+example the output from gunzip), use @code{LOAD DATA LOCAL INFILE}
+instead.
@cindex @code{mysqlimport}
You can also load data files by using the @code{mysqlimport} utility; it
@@ -18574,7 +18600,7 @@ well. If you get warnings and want to know exactly why you got them, one way
to do this is to use @code{SELECT ... INTO OUTFILE} into another file and
compare this to your original input file.
-If you need @code{LOAD DATA INFILE} to read from a pipe, you can use the
+If you need @code{LOAD DATA} to read from a pipe, you can use the
following trick:
@example
@@ -18584,6 +18610,9 @@ cat < /dev/tcp/10.1.1.12/4711 > /nt/mysql/db/x/x
mysql -e "LOAD DATA INFILE 'x' INTO TABLE x" x
@end example
+If you are using and older @strong{MySQL} version than 3.23.25
+you can only do the above with @code{LOAD DATA LOCAL INFILE}.
+
For more information about the efficiency of @code{INSERT} versus
@code{LOAD DATA INFILE} and speeding up @code{LOAD DATA INFILE},
@xref{Insert speed}.
@@ -25578,7 +25607,7 @@ mysql> SELECT ... FROM tbl_name ORDER BY key_part1 DESC,key_part2 DESC,...
@end example
@node LEFT JOIN optimization, LIMIT optimization, Where optimizations, Query Speed
-@subsection How MySQL optimizes @code{LEFT JOIN}
+@subsection How MySQL optimizes @code{LEFT JOIN} and @code{RIGHT JOIN}
@code{A LEFT JOIN B} is in @strong{MySQL} implemented as follows:
@@ -25610,9 +25639,12 @@ table and you have the following test: @code{column_name IS NULL} in the
matches the @code{LEFT JOIN} condition.
@end itemize
-The table read order forced by @code{LEFT JOIN} and @code{STRAIGHT JOIN} will help
-the join optimizer (which calculates in which order tables should be joined) to do
-its work much more quickly as there are fewer table permutations to check.
+@code{RIGHT JOIN} is implemented analogously as @code{LEFT JOIN}.
+
+The table read order forced by @code{LEFT JOIN} and @code{STRAIGHT JOIN}
+will help the join optimizer (which calculates in which order tables
+should be joined) to do its work much more quickly as there are fewer
+table permutations to check.
Note that the above means that if you do a query of type:
@@ -25620,8 +25652,8 @@ Note that the above means that if you do a query of type:
SELECT * FROM a,b LEFT JOIN c ON (c.key=a.key) LEFT JOIN d (d.key=a.key) WHERE b.key=d.key
@end example
-Then @strong{MySQL} will do a full scan on @code{b} as the @code{LEFT JOIN} will
-force it to be read before @code{d}.
+Then @strong{MySQL} will do a full scan on @code{b} as the @code{LEFT
+JOIN} will force it to be read before @code{d}.
The fix in this case is to change the query to:
@@ -30088,11 +30120,17 @@ clients connected to the @code{mysqld} server.
If you need more connections than the default (100), then you should restart
@code{mysqld} with a bigger value for the @code{max_connections} variable.
-Note that @code{mysqld} actually allows (@code{max_connections}+1) clients to connect.
-The last connection is reserved for a user with the @strong{process} privilege.
-By not giving this privilege to normal users (they shouldn't need this), an
-administrator with this privilege can login and use @code{SHOW PROCESSLIST}
-to find out what could be wrong. @xref{SHOW}.
+Note that @code{mysqld} actually allows (@code{max_connections}+1)
+clients to connect. The last connection is reserved for a user with the
+@strong{process} privilege. By not giving this privilege to normal
+users (they shouldn't need this), an administrator with this privilege
+can login and use @code{SHOW PROCESSLIST} to find out what could be
+wrong. @xref{SHOW}.
+
+The maximum number of connects @strong{MySQL} is depending on how good
+the thread library is on a given platform. Linux or Solaris should be
+able to support 500-1000 simultaneous connections, depending on how much
+RAM you have and what your clients are doing.
@node Out of memory, Packet too large, Too many connections, Common errors
@subsection @code{Out of memory} error
@@ -30527,6 +30565,10 @@ shell> export UMASK_DIR
shell> /path/to/safe_mysqld &
@end example
+In @strong{MySQL} 3.23.25 and above, @strong{MySQL} assumes that the
+value for @code{UMASK} and @code{UMASK_DIR} is in octal if it starts
+with a zero.
+
@xref{Environment variables}.
@node Not enough file handles, Using DATE, File permissions , Problems
@@ -36754,6 +36796,20 @@ though, so 3.23 is not released as a stable version yet.
@appendixsubsec Changes in release 3.23.25
@itemize @bullet
@item
+Fixed that databasename works as second argument to @code{mysqlhotcopy}.
+@item
+@code{UMASK} and @code{UMASK_DIR} can now be specified in octal.
+@item
+Added @code{RIGHT JOIN}. This makes @code{RIGHT} a reserved word.
+@item
+Added @code{@@@@IDENTITY} as a synonym for @code{LAST_INSERT_ID()}.
+(for Visual Basic)
+@item
+Fixed bug in myisamchk and @code{REPAIR} when using @code{FULLTEXT} index.
+@item
+@code{LOAD DATA INFILE} now works for FIFO's.
+(Patch by Toni L. Harbaugh-Blackford).
+@item
@code{FLUSH LOGS} broke replication if one had @code{log-bin} with
a log with explicit extension
@item
@@ -41551,6 +41607,10 @@ If @code{mysqld} hangs you can try to use some system tools like
@code{strace} or @code{/usr/proc/bin/pstack} to examine where
@code{mysqld} has hung.
+@example
+strace /tmp/log libexec/mysqld
+@end example
+
If @code{mysqld} starts to eat up CPU or memory or if it ``hangs'', you
can use @code{mysqladmin processlist status} to find out if someone is
executing a query that takes a long time. It may be a good idea to