- Home
- Interview Questions
- MySQL
51.
MySQL - How can I use replication to improve performance of my system?
You should set up one server as the master, and direct all writes to it, and configure as many slaves as you have the money and rackspace for, distributing the reads among the master and the slaves. You can also start the slaves with --skip-bdb, --low-priority-updates and --delay-key-write-for-all-tables to get speed improvements for the slave. In this case the slave will use non-transactional MyISAM tables instead of BDB tables to get more speed.
52.
How do you use mysqldump to create a copy of the database?
mysqldump -h mysqlhost -u username -p mydatabasename > dbdump.sql
53.
How are ENUMs and SETs represented internally?
As unique integers representing the powers of two, due to storage optimizations.
54.
How can you see all indexes defined for a table?
SHOW INDEX FROM techinterviews_questions;
55.
How do you get the number of rows affected by query?
SELECT COUNT (user_id) FROM users would only return the number of user_id's.