Big than 4G datafile can user Myisam merge table.
// query cache does NOT work
$r = mysql_query("SELECT username FROM user WHERE signup_date >= CURDATE()");
// query cache works!
$today = date("Y-m-d");
$r = mysql_query("SELECT username FROM user WHERE signup_date >= '$today'");
t is a good habit to always specify which columns you need when you are doing your SELECT’s.
Vertical Partitioning is the act of splitting your table structure in a vertical manner for optimization reasons.
Example 1: You might have a users table that contains home addresses, that do not get read often. You can choose to split your table and store the address info on a separate table. This way your main users table will shrink in size. As you know, smaller tables perform faster.
Example 2: You have a “last_login” field in your table. It updates every time a user logs in to the website. But every update on a table causes the query cache for that table to be flushed. You can put that field into another table to keep updates to your users table to a minimum.
But you also need to make sure you don’t constantly need to join these 2 tables after the partitioning or you might actually suffer performance decline.
If you have some kind of maintenance script that needs to delete large numbers of rows, just use the LIMIT clause to do it in smaller batches to avoid this congestion.
f you do not need the time component, use DATE instead of DATETIME.
refer :
http://blog.tuvinh.com/top-20-mysql-best-practices/
PreparedStatements are implemented by the driver, as MySQL
does not have a prepared statement feature. Because of this,
the driver does not implement
getParameterMetaData()
or
getMetaData()
as it would require the
driver to have a complete SQL parser in the client.
Starting with version 3.1.0 MySQL Connector/J, server-side prepared statements and binary-encoded result sets are used when the server supports them.
Employee boss("Morris, Melinda", 83000);
Employee* s = &boss;
This is usually not a good idea. As a rule of thumb, C++ pointers should only refer to objects allocated wth new.
聲明,因為c++這種語言,在使用函數和變量的時候,必須將他聲明,為何要聲明?聲明之后才
知道他的規格,才能更好的發現不和規格的部分.你別妄想一個編譯單元,會自動從另一個
編譯單元那里得到什么信息,知道你是如何定義這個函數的.
所以說,只要使用到該函數的單元,就必須寫一份聲明在那個.cpp里面,這樣是不是很麻煩,
而且,如果要修改,就必須一個一個修改.這真讓人受不了.
.h就是為了解決這個問題而誕生,他包含了這些公共的東西.然后所有需要使用該函數的.cpp,只需要
用#include包含進去便可.以后需要修改,也只是修改一份內容.
請注意不要濫用.h,.h里面不要寫代碼,.h不是.cpp的倉庫,什么都塞到里面.
如果在里面寫代碼,當其他.cpp包含他的時候,就會出現重復定義的情況,
比如將函數func(){printf};放到頭文件a.h,里面還有一些a.cpp需要的聲明等;
然后你發現b.cpp需要用到a.cpp里面的一個函數,就很高興的將a.h包含進來.
注意,#include并不是什么申請指令,他就是將指定的文件的內容,原封不動的拷貝
進來.
這時候實際上a.cpp和b.cpp都有一個func()函數的定義.
如果這個函數是內部鏈接static的話,還好,浪費了一倍空間;
如果是extern,外部鏈接(這個是默認情況),那么根據在同一個程序內不可出現
同名函數的要求,連接器會毫不留情給你一個連接錯誤!
http://www.cnblogs.com/shelvenn/archive/2008/02/02/1062446.html
Platform二. Philosophy and discipline
Kernel
Framework
Be aware of context三. Principle
Extreme maintenance
Be pragmatic
Extreme abstract: Program to an interface (abstraction), not an implementation
Extreme separation of concerns
Extreme readability
Testability
No side effect
Do not repeat yourself
DIP ,dependency inversion of control四. design pattern
OCP , open close
LSP , liskov substitute
ISP , interface segregation
SRP , single responsibility
LKP, Lease knowledge principle
Construction
Behavior
Structure
Long method六. algorithms
Diverse change
Repeated code
Talk to stranger
Pre optimize
nLongN
Divided and conqueror
Hierarchal
Pipes and filter
Micro kernel
Broker
Black Board
Interpreter
What to concurrent九. languages
Scalability
Stretch key dimensions to see what breaks
Ruby十. Performance
Erlang
assemble
C
C++
Java
Python
Scala
Be ware of different program paradigms.
Minimize remote calls and other I/O
Speed-up data conversion
release resource as soon as possible
軟件設計思想的發展邏輯,大致是提高抽象程度 ,separation of concern 程度。十二. Reference
fn(design )= fn1(abstraction )+ fn2(separation of concern).
由于大規模數據處理時代的來臨,下一代設計范式的重點:
1. 將是如何提高distributed(--concurrent) programing 的抽象程度 和 separation of concern 程度。
2. dsl ,按照以上的公式,也確實是一個好的方向。
<art agile software development>
<prerefactor>
<design patterns>
<beautiful architecture>
<refactor>
<pattern oriented software architecture>
<extreme software development>
<beautiful code>
<patterns for parallel programming>
<java concurrent programming in practice>
<java performance tuning>
<the definite guide to hadoop>
<greenplum>
<DryadLINQ>
<software architecture in practice>
<97 things architecture should known>
http://en.wikipedia.org/wiki/Programming_paradigm