I am just getting started with MySQL and one of the first things I was
trying is converting one of my larger tables to MySQL to see what kind of
performance I would get from some standard queries that I run against it.

I built the table and created some indices that I thought would boost the
performance for my standard queries. I setup the ODBC on a Windows NT client
(the MySQL database is on Red Hat Linux 7.3 and the MySQL version is 3.23.51
that I downloaded on Wednesday.)

I ran the query below about 15 times successfully using a Visual Basic
program through the ODBC connection. The only queries taking place are
SELECT queries. There are no update queries of any kind being run, yet after
running the select query about 15 times I start getting the error message
below. Is this a standard problem that has a work around? I have dropped the
index and recreated it and I get the same behavior. It works fine for a few
queries and then the message appears.

Thanks for any help.

---------------------------------
mysql> select * from Documents where type = 1 and (medplancd = '          '
or empno ='         ');
ERROR 1034: Incorrect key file for table: 'Documents'. Try to repair it

mysql> explain select * from Documents where type = 1 and (medplancd = '
' or empno ='         ');
+-----------+------+-------------------------------------------------------+
--------------------+---------+-------+--------+------------+
| table     | type | possible_keys                                         |
key                | key_len | ref   | rows   | Extra      |
+-----------+------+-------------------------------------------------------+
--------------------+---------+-------+--------+------------+
| Documents | ref  | empno,type,TypeMedplancd,TypeEmpno,TypeMedplancdEmpno |
TypeMedplancdEmpno |       3 | const | 163829 | where used |
+-----------+------+-------------------------------------------------------+
--------------------+---------+-------+--------+------------+
1 row in set (0.01 sec)

mysql> select * from Documents where type = 2 and (medplancd = '          '
or empno ='         ');
Empty set (1.57 sec)

mysql> explain select * from Documents where type = 2 and (medplancd = '
' or empno ='         ');
+-----------+------+-------------------------------------------------------+
--------------------+---------+-------+-------+------------+
| table     | type | possible_keys                                         |
key                | key_len | ref   | rows  | Extra      |
+-----------+------+-------------------------------------------------------+
--------------------+---------+-------+-------+------------+
| Documents | ref  | empno,type,TypeMedplancd,TypeEmpno,TypeMedplancdEmpno |
TypeMedplancdEmpno |       3 | const | 49701 | where used |
+-----------+------+-------------------------------------------------------+
--------------------+---------+-------+-------+------------+
1 row in set (0.01 sec)

mysql> show columns from Documents;
+--------------+-------------+------+-----+---------+----------------+
| Field        | Type        | Null | Key | Default | Extra          |
+--------------+-------------+------+-----+---------+----------------+
| DOCID        | int(11)     |      | PRI | NULL    | auto_increment |
| DOCNum       | int(11)     | YES  | MUL | NULL    |                |
| Received     | datetime    | YES  | MUL | NULL    |                |
| Type         | smallint(6) | YES  | MUL | NULL    |                |
| Empno        | char(9)     | YES  | MUL | NULL    |                |
| Medplancd    | char(10)    | YES  |     | NULL    |                |
| Pages        | smallint(6) | YES  |     | NULL    |                |
| AcctMngr     | smallint(6) | YES  |     | NULL    |                |
| Entered      | datetime    | YES  |     | NULL    |                |
| Suspended    | datetime    | YES  |     | NULL    |                |
| Adjud        | datetime    | YES  | MUL | NULL    |                |
| BackedUp     | datetime    | YES  |     | NULL    |                |
| CDRef        | char(12)    | YES  |     | NULL    |                |
| DatePrint    | datetime    | YES  |     | NULL    |                |
| Page         | double      | YES  |     | NULL    |                |
| LogDate      | datetime    | YES  |     | NULL    |                |
| Logged       | char(1)     | YES  |     | NULL    |                |
| Descript     | char(40)    | YES  |     | NULL    |                |
| Reviewed     | datetime    | YES  |     | NULL    |                |
| CLAIMPAGES   | smallint(6) | YES  |     | NULL    |                |
| Emailed      | char(1)     | YES  |     | NULL    |                |
| EmailDate    | datetime    | YES  |     | NULL    |                |
| RcvEmail     | char(1)     | YES  |     | NULL    |                |
| RcvEmailDate | datetime    | YES  |     | NULL    |                |
| EntEmail     | char(1)     | YES  |     | NULL    |                |
| EntEmailDate | datetime    | YES  |     | NULL    |                |
| ADJUSER      | smallint(6) | YES  |     | NULL    |                |
+--------------+-------------+------+-----+---------+----------------+
27 rows in set (0.00 sec)


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to