Fossil

Check-in [74854a30]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Added ability to declare indices on tables in the persistent state. Used this to declare indices on critical columns. Slows down the transactions saving changesets, this however is made up when it comes to successor/predecessor retrieval of changesets.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:74854a30b8b4cc44a19fc8e305768fac8c536a14
User & Date: aku 2007-12-02 03:40:56
Context
2007-12-02
03:41
Added progress output to the code loading up the graph to traverse, nodes, and arcs. check-in: 41d41c7b user: aku tags: trunk
03:40
Added ability to declare indices on tables in the persistent state. Used this to declare indices on critical columns. Slows down the transactions saving changesets, this however is made up when it comes to successor/predecessor retrieval of changesets. check-in: 74854a30 user: aku tags: trunk
2007-12-01
18:36
Bugfix. Handle free-floating branches (their root revision was removed as unnecessary). check-in: 79c227a9 user: aku tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tools/cvs2fossil/lib/c2f_pcollrev.tcl.

172
173
174
175
176
177
178
179


180
181
182
183
184
185
186
...
191
192
193
194
195
196
197
198



199
200
201
202
203
204
205
	state writing tag {
	    tid  INTEGER  NOT NULL  PRIMARY KEY AUTOINCREMENT,
	    fid  INTEGER  NOT NULL  REFERENCES file,     -- File the item belongs to
	    lod  INTEGER            REFERENCES symbol,   -- Line of development (NULL => Trunk)
	    sid  INTEGER  NOT NULL  REFERENCES symbol,   -- Symbol capturing the tag

	    rev  INTEGER  NOT NULL  REFERENCES revision  -- The revision being tagged.
	}



	state writing branch {
	    bid   INTEGER  NOT NULL  PRIMARY KEY AUTOINCREMENT,
	    fid   INTEGER  NOT NULL  REFERENCES file,     -- File the item belongs to
	    lod   INTEGER            REFERENCES symbol,   -- Line of development (NULL => Trunk)
	    sid   INTEGER  NOT NULL  REFERENCES symbol,   -- Symbol capturing the branch

................................................................................

	    -- A branch can exist without root. It happens when the
            -- only revision on trunk is the unnecessary dead one the
            -- branch was sprouted from and it has commits. The branch
            -- will exist to be the LOD of its revisions, nothing to
            -- sprout from, the dead revision was removed, hence no
            -- root.
	}




	# Project level ...
	#	pLineOfDevelopment, pSymbol, pBranch, pTag, pTrunk
	#
	#	pTrunk  <- pLineOfDevelopment
	#	pBranch <- pSymbol, pLineOfDevelopment
	#	pTag    <- pSymbol, pLineOfDevelopment







|
>
>







 







|
>
>
>







172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
...
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
	state writing tag {
	    tid  INTEGER  NOT NULL  PRIMARY KEY AUTOINCREMENT,
	    fid  INTEGER  NOT NULL  REFERENCES file,     -- File the item belongs to
	    lod  INTEGER            REFERENCES symbol,   -- Line of development (NULL => Trunk)
	    sid  INTEGER  NOT NULL  REFERENCES symbol,   -- Symbol capturing the tag

	    rev  INTEGER  NOT NULL  REFERENCES revision  -- The revision being tagged.
	} { rev sid }
	# Indices on: rev (revision successors)
	#             sid (tag predecessors, branch successors/predecessors)

	state writing branch {
	    bid   INTEGER  NOT NULL  PRIMARY KEY AUTOINCREMENT,
	    fid   INTEGER  NOT NULL  REFERENCES file,     -- File the item belongs to
	    lod   INTEGER            REFERENCES symbol,   -- Line of development (NULL => Trunk)
	    sid   INTEGER  NOT NULL  REFERENCES symbol,   -- Symbol capturing the branch

................................................................................

	    -- A branch can exist without root. It happens when the
            -- only revision on trunk is the unnecessary dead one the
            -- branch was sprouted from and it has commits. The branch
            -- will exist to be the LOD of its revisions, nothing to
            -- sprout from, the dead revision was removed, hence no
            -- root.
	} { root first sid }
	# Indices on: root  (revision successors)
	#             first (revision predecessors)
	#             sid   (tag predecessors, branch successors/predecessors)

	# Project level ...
	#	pLineOfDevelopment, pSymbol, pBranch, pTag, pTrunk
	#
	#	pTrunk  <- pLineOfDevelopment
	#	pBranch <- pSymbol, pLineOfDevelopment
	#	pTag    <- pSymbol, pLineOfDevelopment

Changes to tools/cvs2fossil/lib/c2f_pcollsym.tcl.

53
54
55
56
57
58
59
60

61
62
63
64
65
66
67
	    -- For each symbol the prefered parent. This describes the
	    -- tree of the found lines of development. Actually a
	    -- forest in case of multiple projects, with one tree per
	    -- project.

	    sid INTEGER  NOT NULL  PRIMARY KEY  REFERENCES symbol,
	    pid INTEGER  NOT NULL               REFERENCES symbol
	}

	return
    }

    typemethod load {} {
	# Pass manager interface. Executed to load data computed by
	# this pass into memory when this pass is skipped instead of
	# executed.







|
>







53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
	    -- For each symbol the prefered parent. This describes the
	    -- tree of the found lines of development. Actually a
	    -- forest in case of multiple projects, with one tree per
	    -- project.

	    sid INTEGER  NOT NULL  PRIMARY KEY  REFERENCES symbol,
	    pid INTEGER  NOT NULL               REFERENCES symbol
	} { pid }
	# Index on: pid (branch successors`)
	return
    }

    typemethod load {} {
	# Pass manager interface. Executed to load data computed by
	# this pass into memory when this pass is skipped instead of
	# executed.

Changes to tools/cvs2fossil/lib/c2f_state.tcl.

91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107








108
109
110
111
112
113
114
	log write 2 state release
	${type}::STATE close
	if {$mypath eq ""} return
	file delete $mypath
	return
    }

    typemethod writing {name definition} {
	# Method for a user to declare a table its needs for storing
	# persistent state, and the expected structure. A possibly
	# previously existing definition is dropped.

	log write 1 state "writing $name" ; # TODO move to level 5 or so

	$mystate transaction {
	    catch { $mystate eval "DROP TABLE $name" }
	    $mystate eval "CREATE TABLE $name ( $definition )"








	}
	return
    }

    typemethod reading {name} {
	log write 1 state "reading $name" ; # TODO move to level 5 or so








|









>
>
>
>
>
>
>
>







91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
	log write 2 state release
	${type}::STATE close
	if {$mypath eq ""} return
	file delete $mypath
	return
    }

    typemethod writing {name definition {indices {}}} {
	# Method for a user to declare a table its needs for storing
	# persistent state, and the expected structure. A possibly
	# previously existing definition is dropped.

	log write 1 state "writing $name" ; # TODO move to level 5 or so

	$mystate transaction {
	    catch { $mystate eval "DROP TABLE $name" }
	    $mystate eval "CREATE TABLE $name ( $definition )"

	    set id 0
	    foreach columns $indices {
		log write 1 state "index   $name$id" ; # TODO move to level 5 or so

		$mystate eval "CREATE INDEX ${name}$id ON ${name} ( [join $columns ,] )"
		incr id
	    }
	}
	return
    }

    typemethod reading {name} {
	log write 1 state "reading $name" ; # TODO move to level 5 or so