--- matt ryan <[EMAIL PROTECTED]> wrote:
> >Do you ever delete from this table?
> 
> Temp table is trunicated before the EBCDIC file is
> loaded
I meant the history table :)

> >Have you removed the unecessary duplicate key on
> the first column of your primary key?
> 
> Have not touched the DIC index yet, I need a backup
> server to change
> indexes, it would take the main server down for too
> long, and it wont be
> that big an increase, it's only a 3 character index,
> I also do joines on
> that field to other tables, so I was hesitant on
> removing that index.

Even if it is only a 3 character index, you still need
to do disk reads/writes to update the values in the
index.  With a huge table like yours one index can
make a big difference.

It will still work fine with joins.  Since it is the
leading column of another index, it will function just
like a normal index.  Having indexes on a and (a,b) is
redundant for searching/joining only a.  If you need
to join/search on b, then a seperate index is required
for b if you have indexed (a,b).


The last option I can think of requires a lot more
work on your part as far as inserting data, but it may
be your only option at this point.  This is why I
asked if you delete data from the history table, as it
makes deletes/updates more problematic as well.

Split the myisam table into seperate tables.  We will
call each table a bucket.

Create a MERGE table of all of them. For selecting the
data.

When inserting, use a hash function on your primary
key values to determine which bucket to insert into. 
If you almost always select by primary key, then you
can optimize your select queries to only look at the
correct bucket as well, and to only use the merge
table when you aren't selecting by primary key.

This will speed your inserts because instead of 258M
rows to search through for each insert there are only
8M if you use 32 buckets.  The biggest benefit is that
you could also insert in parallel using multiple mysql
connections, because you could calculate the bucket as
an additional column in your temporary table, then do
the inserts for all the buckets the same time.




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to