Posted by Baron Schwartz |
Recently I was doing a little work for a client who has MyISAM tables with many columns (the same one Peter wrote about recently). The client’s performance is suffering in part because of the number of columns, which is over 200. The queries are generally pretty simple (sums of columns), but they’re ad-hoc (can access any columns) and it seems tailor-made for a column-oriented database.
I decided it was time to actually give Infobright a try. They have an open-source community edition, which is crippled but not enough to matter for this test. The “Knowledge Grid” architecture seems ideal for the types of queries the client runs. But hey, why not also try MonetDB, another open-source column-oriented database I’ve been meaning to take a look at?
[read more...]
Posted by peter |
It is pretty understood the tables which have long rows tend to be slower than tables with short rows. I was interested to check if the row length is the only thing what matters or if number of columns we have to work with also have an important role. I was interested in peak row processing speed so I looked at full table scan in case data fits in OS cache completely. I created 3 tables – First containing single tinyint column which is almost shortest type possible (CHAR(0) could be taking less space), table with 1 tinyint column and char(99) column and table with 100 tinyint columns. The former two tables have the same row length but have number of column different 50 times. Finally I have created 4th table which is also 100 columns but one of them is VARCHAR causes raw format to be dynamic.
[read more...]
Posted by peter |
It is rather typical for systems to start as MyISAM but as system growths to move to Innodb. The reason of the move could be just desire for better data consistency guaranty or being bitten repairing multiple GB MyISAM table few times, though Table Locks is probably the most important issue – with modern multi core servers not only the fact you can’t well mix SELECTs and UPDATEs but also the fact only one update can be happening at the time can be the problem, not to mention Key Cache which often becomes serious contention issue.
The problem we often run into during migration is Full Text Search indexes which are not supported for Innodb tables. So what can you do ?
[read more...]
Posted by peter |
As I’ve wrote few times using multiple key caches is a great way to get CPU scalability if you’re using MyISAM. It is however very annoying – this feature really looks half baked to me.
The problem with multiple key caches and mapping of tables to the different files is – there is no way to see the existing key caches, their mapping and stats. The only thing you can access is key cache parameters – via structured variables
[read more...]
Posted by
peter @ 8:27 pm ::
myisam ::
Posted by peter |
There is significant portion of customers which are still using MyISAM when they come to us, so one of the big questions is when it is feasible to move to Innodb and when staying on MyISAM is preferred ?
I generally prefer to see Innodb as the main storage engine because it makes life much simpler in the end for most users – you do not get to deal with recovering tables on the crash or partially executed statements. Table locks is no more problem, hot backups are easy, though there are some important things which we have to consider on case by case basics before recommending the move.
[read more...]
Posted by peter |
So lets say you have .frm file for the table and you need to recover CREATE TABLE statement for this table. In particular when we do Innodb Recovery we often get .frm files and some mess in the Innodb tablespace from which we have to get data from. Of course we could relay on old backups (and we do ask for them for a different reason anyway) but there is never guaranty there were no schema changes in between.
So how to recover CREATE TABLE from .frm file ?
[read more...]
Posted by peter |
How would you expect AUTO_INCREMENT to work with MERGE tables ? Assuming INSERT_METHOD=LAST is used I would expect it to work same as in case insertion happens to the last table… which does not seems to be the case. Alternatively I would expect AUTO_INCREMENT to be based off the maximum value across all tables, respecting AUTO_INCREMENT set for the Merge Table itself. Neither of these expectations really true:
[read more...]
Posted by peter |
Take a look at this:
SQL:
-
mysql> repair TABLE a3;
-
+---------+--------+----------+----------+
-
| TABLE | Op | Msg_type | Msg_text |
-
+---------+--------+----------+----------+
-
| test.a3 | repair | STATUS | OK |
-
+---------+--------+----------+----------+
-
1 row IN SET (0.10 sec)
-
-
mysql> SELECT * FROM a3 ORDER BY i;
-
+------------+
-
| i |
-
+------------+
-
| 2147483648 |
-
| 11 |
-
| 13 |
-
| 14 |
-
| 2147483647 |
-
+------------+
-
5 rows IN SET (0.00 sec)
The sort order is obviously wrong while CHECK TABLE is not reporting any error
[read more...]
Posted by
peter @ 4:24 pm ::
myisam ::
Posted by peter |
Following up on my Previous Post I decided to do little test to see how accurate stats we can get for for Index Stats created by ANALYZE TABLE for MyISAM and Innodb.
But before we go into that I wanted to highlight about using ANALYZE TABLE in production as some people seems to be thinking I advice to use it.... a lot. In fact I should say I see more systems which have ANALYZE abused - run too frequently without much need than systems which do not run ANALYZE frequently enough.
[read more...]
Posted by peter |
Today I was working with the client loading data to MyISAM tables at very high rate. Hundreds of millions rows are loaded daily into single MySQL instance with bursts up to 100K of records/sec which need to be inserted (in the table with few indexes). It was good not all records had to go to the same table and so in theory using multiple thread to do inserts in multiple tables would not be bound by table locks and would be able to use multiple cores efficiently to get good insert rate... or so it seemed.
[read more...]