HomeTom - CS
Thursday, March 15, 2012
Wednesday, March 14, 2012
Drop Schema
DROP SCHEMA (Transact-SQL)
DROP SCHEMA schema_name
To drop a schema, any objects (e.g.: tables) associated with the schema must be dropped first.
DROP SCHEMA schema_name
To drop a schema, any objects (e.g.: tables) associated with the schema must be dropped first.
Labels:
MSSQL
Sunday, March 11, 2012
Some articles from CACM
On software engineering: The Risks Of Stopping Too Soon - By David Lorge Parnas
On publication system: Stop the Numbers Game - By David Lorge Parnas
On publication system: Stop the Numbers Game - By David Lorge Parnas
Labels:
CACM
Saturday, March 10, 2012
CSE 231 - Advanced Compiler Design and Implementation
CSE 231 - Advanced Compiler Design and Implementation.
Pay attention to the link "List of Papers for Presentations". These are papers from the most prestigeous conferences on compiler up to 2002.
Pay attention to the link "List of Papers for Presentations". These are papers from the most prestigeous conferences on compiler up to 2002.
Labels:
compiler,
Conference
Tuesday, March 6, 2012
Thursday, February 23, 2012
Optimizing MySQL performance
- Use of IndexReference:
- The EXPLAIN keyword - analyze the execution of a query.
- Avoid calculation on a field. e.g., use "rate < 40" instead of "rate / 2 < 20".
- MySQL uses leftmost prefixing, which means that a multi-field index A,B,C will also be used to search not only for a,b,c combinations, but also A,B as well as just A.
- The Query Optimizer, OPTIMIZE and ANALYZE.
ANALYZE TABLE tablename
OPTIMIZE TABLE tablename
- Use short index: index the first few characters of a field. e.g., ALTER TABLE employee ADD INDEX(surname(20),firstname(20));
- Load data in batch, instead of insert 1-by-1:
$db->query("LOAD DATA INFILE 'datafile.txt' INTO TABLE employee (employee_number,firstname,surname,tel_no,salary) FIELDS TERMINATED BY '|'");
LOAD DATA INFILE has defaults of:
FIELDS TERMINATED BY 't' ENCLOSED BY '' ESCAPED BY ''
INSERT LOW PRIORITY - insert only when no read.
INSERT DELAYED - non-block insert, put insert requests on a queue.
- Fast delete: in MySQL 4.0 or later
TRUNCATE TABLE classifieds;
runs faster than
DELETE FROM classifieds;
since "TRUNCATE" deletes all at once, but "DELETE" deletes one by one.
[1] databasejournal.com: Optimizing MySQL: Queries and Indexes
Subscribe to:
Posts (Atom)