MySQL Forums
Forum List  »  MyISAM

Massive MyISAM query
Posted by: Dave S
Date: May 01, 2017 05:59PM

I need help, I'm way out of my league here.

I have a MyISAM table I inherited. The table is live and being written to 24/7, and quite frequently. It currently holds over 21M rows on a dedicated hosting server.

I need to select out about 4 million rows from it ... somehow ... to get those rows transfered to another physical server that isn't connected in any way. The query to get the rows is very simple:

SELECT * FROM sales WHERE storeid=X

The table has an ID column (autoincrement int) as the PK, and is also indexed on this storeid (int) column.

Is there some "duh, just do this..." type of MySQL feature that I don't know about that would make my life easy? Otherwise I figure I have to break this up into a LOT of smaller queries to prevent locking the table from write, and make things more manageable in terms of saving the data. I figure the way to do this is by (storeid=X) and (id >= Y) and (id <= Z) and use Y and Z as sort of a sliding window of row numbers.

If it matters, each row contains:
- 5 ints
- 3 varchar(64)
- 2 char(36)

Is there some magic to help with this?

Options: ReplyQuote


Subject
Views
Written By
Posted
Massive MyISAM query
1605
May 01, 2017 05:59PM
1024
May 01, 2017 06:16PM
852
May 01, 2017 07:52PM
927
May 01, 2017 09:05PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.