Oracle 5.0 Reference Manual page 2991

Table of Contents

Advertisement

C.5.5.6. Deleting Rows from Related Tables
If the total length of the
the
max_allowed_packet
multiple
DELETE
related_column
isn't indexed, the speed is independent of the number of arguments in the
C.5.5.7. Solving Problems with No Matching Rows
If you have a complicated query that uses many tables but that returns no rows, you should use the
following procedure to find out what is wrong:
1. Test the query with
Section 13.8.2,
2. Select only those columns that are used in the
3. Remove one table at a time from the query until it returns some rows. If the tables are large, it is a
good idea to use
4. Issue a
SELECT
removed from the query.
5. If you are comparing
equality (=) comparisons. This problem is common in most computer languages because not all
floating-point values can be stored with exact precision. In some cases, changing the
DOUBLE
Similar problems may be encountered when comparing
6. If you still cannot figure out what is wrong, create a minimal test that can be run with
< query.sql
mysqldump --quick db_name tbl_name_1 ... tbl_name_n >
in an editor, remove some insert lines (if there are more than needed to demonstrate the problem),
and add your
Verify that the test file demonstrates the problem by executing these commands:
shell>
mysqladmin create test2
shell>
mysql test2 < query.sql
Attach the test file to a bug report, which you can file using the instructions in
Report Bugs or
C.5.5.8. Problems with Floating-Point Values
Floating-point numbers sometimes cause confusion because they are approximate and not stored as
exact values. A floating-point value as written in an SQL statement may not be the same as the value
represented internally. Attempts to treat floating-point values as exact in comparisons may lead to
problems. They are also subject to platform or implementation dependencies. The
data types are subject to these issues. Before MySQL 5.0.3,
approximate as well.
Prior to MySQL 5.0.3,
represented as strings, but calculations on
As of 5.0.6, MySQL performs
5.0.3 to 5.0.5), which should solve most common inaccuracy problems when it comes to
columns. (If your server is from MySQL 5.0.3 or higher, but you have
were created before 5.0.3, the old behavior still applies to those columns. To convert the tables to the
newer
DECIMAL
statement for
DELETE
[466]
system variable), you should split it into smaller parts and execute
statements. You probably get the fastest
values per statement if the
to check whether you can find something that is obviously wrong. See
EXPLAIN
"EXPLAIN
Syntax".
with the query.
LIMIT 10
for the column that should have matched a row against the table that was last
or
FLOAT
DOUBLE
fixes this. See
Section C.5.5.8, "Problems with Floating-Point
that shows your problems. You can create a test file by dumping the tables with
statement at the end of the file.
SELECT
Problems".
columns store values with exact precision because they are
DECIMAL
DECIMAL
format, dump them with
Query-Related Issues
related_table
DELETE
related_column
clause.
WHERE
columns with numbers that have decimals, you cannot use
values are done using floating-point operations.
DECIMAL
operations with a precision of 65 decimal digits (64 digits from
and reload them.)
mysqldump
2971
is more than 1MB (the default value of
by specifying only 100 to 1,000
is indexed. If the
clause.
IN
Values".
values prior to MySQL 5.0.3.
DECIMAL
query.sql. Open the file
Section 1.7, "How to
comparison operations are
DECIMAL
columns in tables that
DECIMAL
related_column
to a
FLOAT
mysql test
and
FLOAT
DOUBLE
DECIMAL

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents