Chinaunix首页 | 论坛 | 博客
  • 博客访问: 970180
  • 博文数量: 120
  • 博客积分: 6454
  • 博客等级: 准将
  • 技术积分: 1739
  • 用 户 组: 普通用户
  • 注册时间: 2007-06-28 17:45
文章分类

全部博文(120)

文章存档

2014年(1)

2013年(1)

2012年(11)

2011年(16)

2010年(6)

2009年(11)

2008年(30)

2007年(44)

分类: Mysql/postgreSQL

2012-07-20 09:54:36


点击(此处)折叠或打开

  1. User enters "INSERT" statement /* client */
  2. |
  3. |
  4. Message goes over TCP/IP line /* vio, various */
  5. |
  6. |
  7. Server parses statement /* sql */
  8. |
  9. |
  10. Server calls low-level functions /* myisam */
  11. |
  12. |
  13. Handler stores in file /* mysys */

The diagram is very simplified it's a caricature that distorts important things, but remember that we've only discussed seven major directories so far: Docs, BUILD, and the five that you see here.

The flow works like this:

First, the client routines get an SQL statement from a user, allowing edit, performing initial checks, and so on.

Then, via the vio routines, the somewhat-massaged statement goes off to the server.

Next, the sql routines handle the parsing and call what's necessary for each individual part of the statement. Along the way, the sql routines will be calling the low level mysys routines frequently.

Finally, one of the ha (handler) programs in the sql directory will dispatch to an appropriate handler for storage. In this case we've assumed, as before, that the handler is myisam so a myisam-directory program is involved. Specifically, that program is mi_write.c, as we mentioned earlier.

Simple, eh?

阅读(1684) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~