MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Peter Grigor Date:January 29 2003 7:09pm
Subject:RE: Cardinality doesn't auto start
View as plain text  
You need to run [analyze table] to create the index this
reasonable often (once a day for a well-used table).

Running [optimize table] on the table recreates index stats AND
reorganizes/defrags/coalesces data this once a week or so.

Look up the mysqlcheck utility--it lets you do this from scrips pretty easy.


> -----Original Message-----
> From: John Hinton [mailto:webify@stripped]
> Sent: Wednesday, January 29, 2003 7:36 AM
> To: mysql@stripped
> Subject: Cardinality doesn't auto start
> mysql  Ver 11.18 Distrib 3.23.54, for pc-linux (i686)
> I'm building an application which will have a self install script,
> intended for use by many people. One particular area of the program
> requires the need for an index. If I create this index when I 
> build the
> table or apparently even after the table is built but before 
> any data is
> written to the table, cardinality is shown as 'None' (using 
> phpMyAdmin)
> and futhermore it does not start counting until after data is entered
> and the index is recreated.
> Seems like when the index is created, if no data is in the table, it
> should be given a default cardinality of 0 and the count continue as
> data is entered.
> This need to create/recreate the index after data is written, is tough
> to deal with as a programmer having to ask the end user to create this
> index after data is gathered.
> Any ideas besides creating an index creater script for the user to run
> later?
> Would this be considered a bug?
> ---- SQL to create table with index ----
> CREATE TABLE somename (
>   ndx int(10) NOT NULL auto_increment,
>   d_now int(7) default NULL,
>   adate timestamp(14) NOT NULL,
>   PRIMARY KEY  (ndx),
>   UNIQUE KEY id (ndx),
>   KEY d_now (d_now)
> ---- end SQL -------
> I have also tried it with d_now set to NOT NULL with the same results.
> The index just won't start counting with no data entered.
> -- 
> John Hinton - Goshen, VA.
> ---------------------------------------------------------------------
> Before posting, please check:
>   (the manual)
>           (the list archive)
> To request this thread, e-mail <mysql-thread131150@stripped>
> To unsubscribe, e-mail 
> <>
> Trouble unsubscribing? Try:
Cardinality doesn't auto startJohn Hinton29 Jan
RE: Cardinality doesn't auto startPeter Grigor29 Jan
  • Re: Cardinality doesn't auto startJohn Hinton30 Jan