⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 metakit's view model.mht

📁 TCL的数据库处理支撑库及一些示例
💻 MHT
📖 第 1 页 / 共 3 页
字号:
From: =?gb2312?B?08kgV2luZG93cyBJbnRlcm5ldCBFeHBsb3JlciA3ILGjtOY=?=
Subject: Metakit's "View" model
Date: Fri, 29 Feb 2008 00:29:01 +0800
MIME-Version: 1.0
Content-Type: multipart/related;
	type="text/html";
	boundary="----=_NextPart_000_005F_01C87A6A.14A37D80"
X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6000.16545

这是 MIME 格式的多方邮件。

------=_NextPart_000_005F_01C87A6A.14A37D80
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Location: http://www.equi4.com/metakit/views.html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" =
"http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<HTML><HEAD><TITLE>Metakit's "View" model</TITLE>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3DISO-8859-1"><LINK=20
href=3D"http://www.equi4.com/css/sheet1.css" type=3Dtext/css =
rel=3Dstylesheet>
<STYLE type=3Dtext/css>BODY {
	MARGIN: 0px; BACKGROUND-COLOR: #fff
}
A:visited {
	COLOR: #8b0000; TEXT-DECORATION: underline
}
.FWExtra {
=09
}
.FWExtra A:link {
	TEXT-DECORATION: none
}
.FWExtra A:active {
	TEXT-DECORATION: none
}
.FWExtra A:visited {
	TEXT-DECORATION: none
}
.FWExtra A:hover {
	TEXT-DECORATION: underline
}
</STYLE>
<!--[if lt IE 7]><link rel=3Dstylesheet type=3D"text/css" =
href=3D"../css/ie6.css"><![endif]-->
<META content=3D"MSHTML 6.00.6000.16609" name=3DGENERATOR></HEAD>
<BODY>
<DIV id=3DPageDiv>
<TABLE cellSpacing=3D0 cellPadding=3D0 width=3D611 border=3D0>
  <TBODY>
  <TR vAlign=3Dtop>
    <TD colSpan=3D4 height=3D26></TD>
    <TD height=3D26></TD></TR>
  <TR vAlign=3Dtop>
    <TD height=3D35 rowSpan=3D2></TD>
    <TD height=3D35 rowSpan=3D2><A =
href=3D"http://www.equi4.com/index.html"><IMG=20
      style=3D"FLOAT: left" height=3D35 alt=3D"Equi4 Software"=20
      src=3D"http://www.equi4.com/Resources/equi4.gif" width=3D97 =
border=3D0></A></TD>
    <TD height=3D35 rowSpan=3D2></TD>
    <TD height=3D22><IMG style=3D"FLOAT: left" height=3D22 alt=3Dmetakit =

      src=3D"http://www.equi4.com/Resources/metakit.gif" width=3D450 =
border=3D0></TD>
    <TD height=3D22></TD></TR>
  <TR vAlign=3Dtop>
    <TD height=3D13><IMG style=3D"LEFT: 158px; FLOAT: left; POSITION: =
relative"=20
      height=3D12 alt=3D"" =
src=3D"http://www.equi4.com/Resources/item2bb.gif"=20
      width=3D292 border=3D0></TD>
    <TD height=3D13></TD></TR>
  <TR class=3Df-sp>
    <TD width=3D35 height=3D24><IMG style=3D"FLOAT: left" height=3D1 =
alt=3D""=20
      src=3D"http://www.equi4.com/Resources/_clear.gif" width=3D35 =
border=3D0></TD>
    <TD width=3D97 height=3D24><IMG style=3D"FLOAT: left" height=3D1 =
alt=3D""=20
      src=3D"http://www.equi4.com/Resources/_clear.gif" width=3D97 =
border=3D0></TD>
    <TD width=3D28 height=3D24><IMG style=3D"FLOAT: left" height=3D1 =
alt=3D""=20
      src=3D"http://www.equi4.com/Resources/_clear.gif" width=3D28 =
border=3D0></TD>
    <TD width=3D450 height=3D24><IMG style=3D"FLOAT: left" height=3D1 =
alt=3D""=20
      src=3D"http://www.equi4.com/Resources/_clear.gif" width=3D450 =
border=3D0></TD>
    <TD width=3D1 height=3D24><IMG style=3D"FLOAT: left" height=3D1 =
alt=3D""=20
      src=3D"http://www.equi4.com/Resources/_clear.gif" width=3D1=20
  border=3D0></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=3D0 cellPadding=3D0 width=3D791 border=3D0>
  <TBODY>
  <TR vAlign=3Dtop>
    <TD class=3DFWExtra>
      <P class=3Drightaligned><SPAN class=3Dcapsub>top pages</SPAN></P>
      <P class=3Drightaligned>&nbsp;</P>
      <P class=3Drightaligned><A=20
      href=3D"http://www.equi4.com/metakit/index.html">Metakit</A><A=20
      =
href=3D"http://www.equi4.com/tclkit/index.html"><BR>Tclkit<BR></A><A=20
      href=3D"http://www.equi4.com/starkit/index.html">Starkit</A><BR><A =

      href=3D"http://www.equi4.com/catfish/index.html">CatFish</A></P>
      <P class=3Drightaligned>&nbsp;</P>
      <P class=3Drightaligned><SPAN class=3Dcapsub>Soapbox</SPAN></P>
      <P class=3Drightaligned>&nbsp;</P>
      <P class=3Drightaligned><A =
href=3D"http://www.equi4.com/jcw/">Blog</A><BR><A=20
      href=3D"http://www.equi4.com/moam/">Musings</A><BR><A=20
      href=3D"http://wiki.tcl.tk/">Tclers' Wiki</A><BR><A=20
      href=3D"http://mini.net/sax/"></A></P>
      <P class=3Drightaligned><SPAN class=3Dcapsub>Company</SPAN></P>
      <P class=3Drightaligned>&nbsp;</P>
      <P class=3Drightaligned><A=20
      href=3D"http://www.equi4.com/about/index.html">About</A><BR><A=20
      =
href=3D"http://www.equi4.com/about/services.html">Services</A><BR><A=20
      href=3D"http://www.equi4.com/about/contact.html">Contact =
info</A><BR><A=20
      =
href=3D"http://www.equi4.com/about/support.html">Support</A></P></TD>
    <TD></TD>
    <TD class=3DFWExtra>
      <P class=3Dcapsub>Metakit's "View" model</P>
      <P>Metakit is based on a carefully chosen mix of relational and=20
      hierarchical concepts. The core model is most <SPAN=20
      class=3Dstyle7>definitely</SPAN> relational. For a number of =
reasons,=20
      Metakit uses a somewhat different terminology, i.e. not relations, =
tables,=20
      records, or fields.</P>
      <P><IMG style=3D"FLOAT: right; MARGIN: 0px" height=3D97 =
alt=3Dvcells=20
      src=3D"http://www.equi4.com/Resources/vcells.gif" width=3D136 =
border=3D0><SPAN=20
      class=3Dcapsub>Views</SPAN></P>
      <P>A <SPAN class=3Dbold>view</SPAN> is an NxM matrix. It has N =
<SPAN=20
      class=3Dbold>rows</SPAN> (numbered 0..N-1) and M <SPAN=20
      class=3Dbold>columns</SPAN> (these are referred to by name, not by =

      position). On the right is a view with 5 rows, 6 columns.</P>
      <P>Views have a number of important properties:</P>
      <UL class=3Dbulletlist>
        <LI>all cells in a column have the same type, i.e. columns are=20
homogenous
        <LI>each of the cells in one row can have different types: int, =
string,=20
        float, etc
        <LI>in addition, there is one special type: "subviews" =
...</LI></UL>
      <P>The most important difference between Metakit and purely =
relational=20
      databases, is that it supports nesting of views:</P>
      <P><IMG style=3D"MARGIN: 0px; VERTICAL-ALIGN: baseline" =
height=3D155 alt=3Dvsub=20
      src=3D"http://www.equi4.com/Resources/vsub.gif" width=3D403 =
border=3D0></P>
      <P>This nesting is somewhat similar to "repeating fields" in some =
database=20
      systems.</P>
      <P><IMG style=3D"FLOAT: left; MARGIN: 0px" height=3D109 =
alt=3Dvrows=20
      src=3D"http://www.equi4.com/Resources/vrows.gif" width=3D156=20
      border=3D0>Traditionally, databases are organized in a row-like =
fashion, as=20
      shown here on the left. It is usually not just the conceptual =
model, but=20
      also the way data is stored on disk, i.e. all data belonging to a =
single=20
      row is stored in a contiguous range of bytes. Fetching a row then =
gives=20
      access to all the data in the row.<BR>&nbsp;</P>
      <P><IMG style=3D"FLOAT: right; MARGIN: 0px" height=3D108 =
alt=3Dvcols=20
      src=3D"http://www.equi4.com/Resources/vcols.gif" width=3D153 =
border=3D0><SPAN=20
      class=3Dcapsub>columns</SPAN></P>
      <P>In Metakit, this approach has been turned on its head - =
literally. This=20
      "inverted" design puts the data belonging to one row all over the =
disk.=20
      Instead, everything is stored in a column-wise format.</P>
      <P><SPAN class=3Dstyle7>This has </SPAN><SPAN=20
      class=3Dstyle18>far-reaching</SPAN><SPAN class=3Dstyle7>=20
      implications!</SPAN></P>
      <P>For one, it's considerably harder to insert and delete "rows" =
in a=20
      column-wise world. Each column of the view needs to be changed, =
with bytes=20
      inserted or removed, and moving potentially large amounts of data =
to make=20
      space or fill up the space.</P>
      <P>The reason this makes sense at all, is the insight that <SPAN=20
      class=3Dstyle7>performance only matters in cases which are done=20
      frequently</SPAN>. Which almost always means inside tight loops. =
<SPAN=20
      class=3Dstyle17>And </SPAN><SPAN class=3Dstyle7>tight loops tend =
to iterate=20
      over rows, not columns!</SPAN></P>
      <P class=3Drightaligned><A=20
      =
href=3D"http://www.equi4.com/metakit/views2.html">Continued...</A></P></T=
D>
    <TD></TD>
    <TD class=3DFWExtra>
      <P><SPAN class=3Dcapsub>metakit index</SPAN></P>
      <P>=95 <A href=3D"http://www.equi4.com/metakit/index.html">Metakit =
home=20
      page</A></P>
      <P>=95 <A =
href=3D"http://www.equi4.com/metakit/overview.html">Overview</A></P>
      <P>=95 <A=20
href=3D"http://www.equi4.com/metakit/docs.html">Documentation</A></P>
      <P>=95 <A =
href=3D"http://www.equi4.com/metakit/license.html">Licensing</A></P>
      <P>=95 <A=20
      =
href=3D"http://www.equi4.com/metakit/acks.html">Acknowledgements</A></P>
      <P>=95 <A =
href=3D"http://www.equi4.com/metakit/quotes.html">Quotes</A></P>
      <P class=3Df-lp>=95 <A=20
      =
href=3D"http://www.equi4.com/metakit/links.html">Links</A></P></TD></TR>
  <TR class=3Df-sp>
    <TD width=3D130 height=3D25><IMG style=3D"FLOAT: left" height=3D1 =
alt=3D""=20
      src=3D"http://www.equi4.com/Resources/_clear.gif" width=3D130 =
border=3D0></TD>
    <TD width=3D30 height=3D25><IMG style=3D"FLOAT: left" height=3D1 =
alt=3D""=20
      src=3D"http://www.equi4.com/Resources/_clear.gif" width=3D30 =
border=3D0></TD>
    <TD width=3D450 height=3D25><IMG style=3D"FLOAT: left" height=3D1 =
alt=3D""=20
      src=3D"http://www.equi4.com/Resources/_clear.gif" width=3D450 =
border=3D0></TD>
    <TD width=3D30 height=3D25><IMG style=3D"FLOAT: left" height=3D1 =
alt=3D""=20
      src=3D"http://www.equi4.com/Resources/_clear.gif" width=3D30 =
border=3D0></TD>
    <TD width=3D150 height=3D25><IMG style=3D"FLOAT: left" height=3D1 =
alt=3D""=20
      src=3D"http://www.equi4.com/Resources/_clear.gif" width=3D150 =
border=3D0></TD>
    <TD width=3D1 height=3D25><IMG style=3D"FLOAT: left" height=3D1 =
alt=3D""=20
      src=3D"http://www.equi4.com/Resources/_clear.gif" width=3D1=20
  border=3D0></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=3D0 cellPadding=3D0 width=3D801 border=3D0>
  <TBODY>
  <TR vAlign=3Dtop>
    <TD height=3D20></TD>
    <TD class=3DFWExtra height=3D20>
      <P class=3D"footer f-lp">Copyright =A9 2008 Equi4 Software. =
Metakit is a=20
      trademark of Equi4 Software.</P></TD>
    <TD height=3D20></TD></TR>
  <TR class=3Df-sp>
    <TD width=3D160 height=3D1><IMG style=3D"FLOAT: left" height=3D1 =
alt=3D""=20
      src=3D"http://www.equi4.com/Resources/_clear.gif" width=3D160 =

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -