<?xml version="1.0" encoding="utf-8" ?>
<rdf:RDF
  xmlns="http://purl.org/rss/1.0/"
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
 >

  <channel rdf:about="http://sourceforge.jp/projects/pydumpfs/wiki/!feeds/list">
    <title>PyDumpFS Wiki</title>
    <link>http://sourceforge.jp/projects/pydumpfs/wiki/!feeds/list</link>
    <description>
      SourceForge.jp Wiki pages for PyDumpFS project.    </description>
        <dc:date>2009-06-08T19:53:24+09:00</dc:date>
        <items>
      <rdf:Seq>
                <rdf:li rdf:resource="http://sourceforge.jp/projects/pydumpfs/wiki/sqlite%E3%81%AB%E3%82%88%E3%82%8B%E6%93%AC%E4%BC%BCFS" />
              </rdf:Seq>
    </items>
  </channel>

      <item rdf:about="http://sourceforge.jp/projects/pydumpfs/wiki/sqlite%E3%81%AB%E3%82%88%E3%82%8B%E6%93%AC%E4%BC%BCFS">
    <title>sqliteによる擬似FS</title>
    <link>http://sourceforge.jp/projects/pydumpfs/wiki/sqlite%E3%81%AB%E3%82%88%E3%82%8B%E6%93%AC%E4%BC%BCFS</link>
    <dc:identifier>sqliteによる擬似FS</dc:identifier>
    <dc:date>2009-06-08T19:53:24+09:00</dc:date>
        <description>
      <![CDATA[== 意図
ハードリンクを使えないFileSystemやOSでPyDumpFSを動作させるために独自のFileSystemを持たせる

== 試案
=== 試案1　素直に実装版
1ファイルないしは複数ファイルで構成。
複数ファイルに分ける場合は&quot;root_node&quot;テーブルは必要なく&quot;directory_entry&quot;と&quot;file_ent]]>
    </description>
    <content:encoded>
      <![CDATA[<h2 id="h2-.E6.84.8F.E5.9B.B3">意図</h2><p>ハードリンクを使えない<a href="http://sourceforge.jp/projects/pydumpfs/wiki/FileSystem">FileSystem</a>やOSで<a href="http://sourceforge.jp/projects/pydumpfs/wiki/PyDump">PyDump</a>FSを動作させるために独自の<a href="http://sourceforge.jp/projects/pydumpfs/wiki/FileSystem">FileSystem</a>を持たせる
</p><h2 id="h2-.E8.A9.A6.E6.A1.88">試案</h2><h3 id="h3-.E8.A9.A6.E6.A1.881.E3.80.80.E7.B4.A0.E7.9B.B4.E3.81.AB.E5.AE.9F.E8.A3.85.E7.89.88">試案1　素直に実装版</h3><p>1ファイルないしは複数ファイルで構成。
複数ファイルに分ける場合は&quot;root_node&quot;テーブルは必要なく&quot;directory_entry&quot;と&quot;file_entry&quot;を格納するファイルをバックアップするごとに作成して、&quot;data_entry&quot;は使いまわすことで全体的な容量を削減する。
</p><pre>
<B><FONT COLOR="#A020F0">create</FONT></B> <B><FONT COLOR="#A020F0">table</FONT></B> root_node(
 id <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">PRIMARY</FONT></B> <B><FONT COLOR="#A020F0">KEY</FONT></B> AUTOINCREMENT,
 cdate <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B> <B><FONT COLOR="#A020F0">default</FONT></B> CURRENT_TIMESTAMP,
 root_directory <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B> <B><FONT COLOR="#A020F0">REFERENCES</FONT></B> directory_entry(id)
);
<B><FONT COLOR="#A020F0">create</FONT></B> <B><FONT COLOR="#A020F0">table</FONT></B> directory_entry(
 id <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">PRIMARY</FONT></B> <B><FONT COLOR="#A020F0">KEY</FONT></B> AUTOINCREMENT,
 name <B><FONT COLOR="#A020F0">text</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 uid <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 gid <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 atime <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 mtime <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 ctime <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 mode blob <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 parent <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">DEFAULT</FONT></B> -1
);
<B><FONT COLOR="#A020F0">create</FONT></B> <B><FONT COLOR="#A020F0">table</FONT></B> file_entry(
 id <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">PRIMARY</FONT></B> <B><FONT COLOR="#A020F0">KEY</FONT></B> AUTOINCREMENT,
 name <B><FONT COLOR="#A020F0">text</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 uid <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 gid <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 atime <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 mtime <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 ctime <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 mode blob <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 parent_directory <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B> <B><FONT COLOR="#A020F0">REFERENCES</FONT></B> directory_entry(id),
 data <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B> <B><FONT COLOR="#A020F0">REFERENCES</FONT></B> data_entry(id)
);
<B><FONT COLOR="#A020F0">create</FONT></B> <B><FONT COLOR="#A020F0">table</FONT></B> data_entry(
 id <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">PRIMARY</FONT></B> <B><FONT COLOR="#A020F0">KEY</FONT></B> AUTOINCREMENT,
 hash_md5 blob <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 hash_sha1 blob <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 size <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 rdata blob,
 <B><FONT COLOR="#A020F0">unique</FONT></B> (hash_md5,hash_sha1)
);

<B><FONT COLOR="#A020F0">create</FONT></B> <B><FONT COLOR="#A020F0">index</FONT></B> directory_tree_index <B><FONT COLOR="#A020F0">on</FONT></B> directory_entry(parent);
<B><FONT COLOR="#A020F0">create</FONT></B> <B><FONT COLOR="#A020F0">index</FONT></B> directory_file_index <B><FONT COLOR="#A020F0">on</FONT></B> file_entry(parent_directory);
<B><FONT COLOR="#A020F0">create</FONT></B> <B><FONT COLOR="#A020F0">index</FONT></B> directory_name <B><FONT COLOR="#A020F0">on</FONT></B> directory_entry(name);
<B><FONT COLOR="#A020F0">create</FONT></B> <B><FONT COLOR="#A020F0">index</FONT></B> file_name <B><FONT COLOR="#A020F0">on</FONT></B> file_entry(name);
</pre><h3 id="h3-.E8.A9.A6.E6.A1.882.E3.80.80.E3.83.95.E3.82.A1.E3.82.A4.E3.83.AB.E3.82.92.E9.81.A9.E5.BD.93.E3.81.AA.E3.83.96.E3.83.AD.E3.83.83.E3.82.AF.E3.81.AB.E5.88.86.E3.81.91.E3.81.A6.E6.A0.BC.E7.B4.8D.E7.89.88">試案2　ファイルを適当なブロックに分けて格納版</h3><p>1ファイルないしは複数ファイルで構成。
複数ファイルに分ける場合は&quot;root_node&quot;テーブルは必要なく&quot;directory_entry&quot;と&quot;file_entry&quot;を格納するファイルをバックアップするごとに作成して、&quot;data_list_entry&quot;と&quot;data_blk_entry&quot;は使いまわすことで全体的な容量を削減する。
</p><p>ブロックに分ける理由は、更なる容量削減のため。
別ファイルであってもブロック単位では一致していればそのブロックは共有することで使用容量を削減する。
ブロックサイズは熟慮の必要あり。
</p><pre>
<B><FONT COLOR="#A020F0">create</FONT></B> <B><FONT COLOR="#A020F0">table</FONT></B> root_node(
 id <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">PRIMARY</FONT></B> <B><FONT COLOR="#A020F0">KEY</FONT></B> AUTOINCREMENT,
 cdate <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B> <B><FONT COLOR="#A020F0">default</FONT></B> CURRENT_TIMESTAMP,
 root_directory <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B> <B><FONT COLOR="#A020F0">REFERENCES</FONT></B> directory_entry(id)
);
<B><FONT COLOR="#A020F0">create</FONT></B> <B><FONT COLOR="#A020F0">table</FONT></B> directory_entry(
 id <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">PRIMARY</FONT></B> <B><FONT COLOR="#A020F0">KEY</FONT></B> AUTOINCREMENT,
 name <B><FONT COLOR="#A020F0">text</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 uid <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 gid <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 atime <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 mtime <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 ctime <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 mode blob <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 parent <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">DEFAULT</FONT></B> -1
);
<B><FONT COLOR="#A020F0">create</FONT></B> <B><FONT COLOR="#A020F0">table</FONT></B> file_entry(
 id <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">PRIMARY</FONT></B> <B><FONT COLOR="#A020F0">KEY</FONT></B> AUTOINCREMENT,
 name <B><FONT COLOR="#A020F0">text</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 uid <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 gid <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 atime <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 mtime <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 ctime <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 size <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 mode blob <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 parent_directory <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B> <B><FONT COLOR="#A020F0">REFERENCES</FONT></B> directory_entry(id) <B><FONT COLOR="#A020F0">default</FONT></B> -1,
 data <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B> <B><FONT COLOR="#A020F0">REFERENCES</FONT></B> data_list_entry(id)
);
<B><FONT COLOR="#A020F0">create</FONT></B> <B><FONT COLOR="#A020F0">table</FONT></B> data_list_entry(
 id <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">PRIMARY</FONT></B> <B><FONT COLOR="#A020F0">KEY</FONT></B> AUTOINCREMENT,
 rdata_blk1 <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B> <B><FONT COLOR="#A020F0">REFERENCES</FONT></B> data_blk_entry(id) <B><FONT COLOR="#A020F0">default</FONT></B> -1,
 rdata_blk2 <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B> <B><FONT COLOR="#A020F0">REFERENCES</FONT></B> data_blk_entry(id) <B><FONT COLOR="#A020F0">default</FONT></B> -1,
 rdata_blk3 <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B> <B><FONT COLOR="#A020F0">REFERENCES</FONT></B> data_blk_entry(id) <B><FONT COLOR="#A020F0">default</FONT></B> -1,
 rdata_blk4 <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B> <B><FONT COLOR="#A020F0">REFERENCES</FONT></B> data_blk_entry(id) <B><FONT COLOR="#A020F0">default</FONT></B> -1,
 rdata_blk5 <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B> <B><FONT COLOR="#A020F0">REFERENCES</FONT></B> data_blk_entry(id) <B><FONT COLOR="#A020F0">default</FONT></B> -1,
 next_list <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">default</FONT></B> -1
);
<B><FONT COLOR="#A020F0">create</FONT></B> <B><FONT COLOR="#A020F0">table</FONT></B> data_blk_entry(
 id <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">PRIMARY</FONT></B> <B><FONT COLOR="#A020F0">KEY</FONT></B> AUTOINCREMENT,
 hash_md5 blob <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 hash_sha1 blob <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 rdata blob,
 size <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 <B><FONT COLOR="#A020F0">unique</FONT></B> (hash_md5,hash_sha1)
);

<B><FONT COLOR="#A020F0">create</FONT></B> <B><FONT COLOR="#A020F0">index</FONT></B> directory_tree_index <B><FONT COLOR="#A020F0">on</FONT></B> directory_entry(parent);
<B><FONT COLOR="#A020F0">create</FONT></B> <B><FONT COLOR="#A020F0">index</FONT></B> directory_file_index <B><FONT COLOR="#A020F0">on</FONT></B> file_entry(parent_directory);
<B><FONT COLOR="#A020F0">create</FONT></B> <B><FONT COLOR="#A020F0">index</FONT></B> directory_name <B><FONT COLOR="#A020F0">on</FONT></B> directory_entry(name);
<B><FONT COLOR="#A020F0">create</FONT></B> <B><FONT COLOR="#A020F0">index</FONT></B> file_name <B><FONT COLOR="#A020F0">on</FONT></B> file_entry(name);
<B><FONT COLOR="#A020F0">create</FONT></B> <B><FONT COLOR="#A020F0">index</FONT></B> data_list_link <B><FONT COLOR="#A020F0">on</FONT></B> data_list_entry(next_list);

</pre><h3 id="h3-.E8.A9.A6.E6.A1.883.20.E5.AE.9F.E3.83.87.E3.83.BC.E3.82.BF.E3.81.AF.E3.83.87.E3.83.BC.E3.82.BF.E3.83.99.E3.83.BC.E3.82.B9.E3.81.AE.E5.A4.96.E3.81.AB.E6.A0.BC.E7.B4.8D.E7.89.88">試案3 実データはデータベースの外に格納版</h3><p>ファイル情報はデータベース内に保持するが、実データは何らかのハッシュをファイル名にして管理。
ファイル数が多くなることが予想されるので適当にディレクトリで分割。
そこにたどり着くパス名全体でハッシュ値を表すようにする。
</p><p>ex.)ハッシュが&quot;9f6e6800c&quot;で3段のディレクトリに分けるなら&quot;./9f/6e/68/00c&quot;といったパスになる
</p><p>実データは適当な大きさのブロックで分割。
</p><pre>
<B><FONT COLOR="#A020F0">create</FONT></B> <B><FONT COLOR="#A020F0">table</FONT></B> root_node(
 id <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">PRIMARY</FONT></B> <B><FONT COLOR="#A020F0">KEY</FONT></B> AUTOINCREMENT,
 cdate <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B> <B><FONT COLOR="#A020F0">default</FONT></B> CURRENT_TIMESTAMP,
 root_directory <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B> <B><FONT COLOR="#A020F0">REFERENCES</FONT></B> directory_entry(id)
);
<B><FONT COLOR="#A020F0">create</FONT></B> <B><FONT COLOR="#A020F0">table</FONT></B> directory_entry(
 id <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">PRIMARY</FONT></B> <B><FONT COLOR="#A020F0">KEY</FONT></B> AUTOINCREMENT,
 name <B><FONT COLOR="#A020F0">text</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 uid <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 gid <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 atime <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 mtime <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 ctime <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 mode blob <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 parent <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">DEFAULT</FONT></B> -1
);
<B><FONT COLOR="#A020F0">create</FONT></B> <B><FONT COLOR="#A020F0">table</FONT></B> file_entry(
 id <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">PRIMARY</FONT></B> <B><FONT COLOR="#A020F0">KEY</FONT></B> AUTOINCREMENT,
 name <B><FONT COLOR="#A020F0">text</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 uid <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 gid <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 atime <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 mtime <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 ctime <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 size <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 mode blob <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 parent_directory <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B> <B><FONT COLOR="#A020F0">REFERENCES</FONT></B> directory_entry(id) <B><FONT COLOR="#A020F0">default</FONT></B> -1,
 data <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B> <B><FONT COLOR="#A020F0">REFERENCES</FONT></B> data_list_entry(id)
);
<B><FONT COLOR="#A020F0">create</FONT></B> <B><FONT COLOR="#A020F0">table</FONT></B> data_list_entry(
 id <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">PRIMARY</FONT></B> <B><FONT COLOR="#A020F0">KEY</FONT></B> AUTOINCREMENT,
 rdata_hash1 <B><FONT COLOR="#A020F0">text</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 rdata_hash2 <B><FONT COLOR="#A020F0">text</FONT></B>,
 rdata_hash3 <B><FONT COLOR="#A020F0">text</FONT></B>,
 rdata_hash4 <B><FONT COLOR="#A020F0">text</FONT></B>,
 next_list <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">default</FONT></B> -1
);

<B><FONT COLOR="#A020F0">create</FONT></B> <B><FONT COLOR="#A020F0">index</FONT></B> directory_tree_index <B><FONT COLOR="#A020F0">on</FONT></B> directory_entry(parent);
<B><FONT COLOR="#A020F0">create</FONT></B> <B><FONT COLOR="#A020F0">index</FONT></B> directory_file_index <B><FONT COLOR="#A020F0">on</FONT></B> file_entry(parent_directory);
<B><FONT COLOR="#A020F0">create</FONT></B> <B><FONT COLOR="#A020F0">index</FONT></B> directory_name <B><FONT COLOR="#A020F0">on</FONT></B> directory_entry(name);
<B><FONT COLOR="#A020F0">create</FONT></B> <B><FONT COLOR="#A020F0">index</FONT></B> file_name <B><FONT COLOR="#A020F0">on</FONT></B> file_entry(name);
<B><FONT COLOR="#A020F0">create</FONT></B> <B><FONT COLOR="#A020F0">index</FONT></B> data_list_link <B><FONT COLOR="#A020F0">on</FONT></B> data_list_entry(next_list);

</pre><h3 id="h3-.E8.A9.A6.E6.A1.884.20.E4.BB.96.E3.81.AEFileSystem.E3.82.92.E5.8F.82.E8.80.83.E3.81.AB.E7.89.88">試案4 他の<a href="http://sourceforge.jp/projects/pydumpfs/wiki/FileSystem">FileSystem</a>を参考に版</h3><p>ディレクトリツリーの有向グラフの向きが上述の3つとは逆。
inode_num==0がルートディレクトリ。
ファイル名はリンクリストで管理。
<pre>
<B><FONT COLOR="#A020F0">create</FONT></B> <B><FONT COLOR="#A020F0">table</FONT></B> inode(
 inode_num <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 rev_id <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 uid <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 gid <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 atime <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 mtime <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 ctime <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 dev_num <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 nlink <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 size <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 mode blob <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 data_id <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>
);

<B><FONT COLOR="#A020F0">create</FONT></B> <B><FONT COLOR="#A020F0">table</FONT></B> d_data(
 id <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">PRIMARY</FONT></B> <B><FONT COLOR="#A020F0">KEY</FONT></B> AUTOINCREMENT,
 fname1 <B><FONT COLOR="#A020F0">text</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 inum1 <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 fname2 <B><FONT COLOR="#A020F0">text</FONT></B>,
 inum2 <B><FONT COLOR="#A020F0">integer</FONT></B>,
 fname3 <B><FONT COLOR="#A020F0">text</FONT></B>,
 inum3 <B><FONT COLOR="#A020F0">integer</FONT></B>,
 fname4 <B><FONT COLOR="#A020F0">text</FONT></B>,
 inum4 <B><FONT COLOR="#A020F0">integer</FONT></B>,
 next_id <B><FONT COLOR="#A020F0">integer</FONT></B>
);

<B><FONT COLOR="#A020F0">create</FONT></B> <B><FONT COLOR="#A020F0">table</FONT></B> f_data(
 id <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">PRIMARY</FONT></B> <B><FONT COLOR="#A020F0">KEY</FONT></B> AUTOINCREMENT,
 rdata_hash1 <B><FONT COLOR="#A020F0">text</FONT></B> <B><FONT COLOR="#A020F0">not</FONT></B> <B><FONT COLOR="#A020F0">null</FONT></B>,
 rdata_hash2 <B><FONT COLOR="#A020F0">text</FONT></B>,
 rdata_hash3 <B><FONT COLOR="#A020F0">text</FONT></B>,
 rdata_hash4 <B><FONT COLOR="#A020F0">text</FONT></B>,
 next_id <B><FONT COLOR="#A020F0">integer</FONT></B> <B><FONT COLOR="#A020F0">default</FONT></B> -1
);

<B><FONT COLOR="#A020F0">create</FONT></B> <B><FONT COLOR="#A020F0">index</FONT></B> inode_num_index <B><FONT COLOR="#A020F0">on</FONT></B> inode(inode_num);

</pre></p>]]>
    </content:encoded>
      </item>
    </rdf:RDF>

