Skip to content

Commit f3ef277

Browse files
author
Ralf Schlatterbeck
committed
Indexing fixes.
- Add new rdbms-indexes to the tables for the full-text index. These speed up adding new entries and finding old ones to remove. - Remove getprops method from FileClass in backends/rdbms_common: This forced indexing for the content property even if the user decided to turn it off for a FileClass instance.
1 parent 9428c97 commit f3ef277

File tree

6 files changed

+25
-17
lines changed

6 files changed

+25
-17
lines changed

CHANGES.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ Fixed:
1717
- Fix handling of defaults for date fields
1818
- Fix <form> name in user editing to allow multilink popups to work
1919
- Fix form handling of editing existing hyperdb items from a new item page.
20-
20+
- Added new rdbms-indexes for full-text index which will speed up
21+
reindexing.
22+
- Turning off indexing for content properties of FileClass instance
23+
(e.g., "file" and "msg") now works for SQL backends.
2124

2225
2007-02-15 1.3.3
2326
Fixed:

doc/upgrading.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ update the messagesummary detector as follows::
3232
+ summary, content = parseContent(newvalues['content'], config=db.config)
3333
newvalues['summary'] = summary
3434

35+
In the latest version we have added some database indexes to the
36+
SQL-backends (mysql, postgresql, sqlite) for speeding up building the
37+
roundup-index for full-text search. We recommend that you create the
38+
following database indexes on the database by hand::
39+
40+
CREATE INDEX words_by_id ON __words (_textid)
41+
CREATE UNIQUE INDEX __textids_by_props ON __textids (_class, _itemid, _prop)
42+
3543
Migrating from 1.2.x to 1.3.0
3644
=============================
3745

roundup/backends/back_mysql.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#$Id: back_mysql.py,v 1.71 2006-08-29 04:20:50 richard Exp $
1+
#$Id: back_mysql.py,v 1.72 2007-06-21 07:35:50 schlatterbeck Exp $
22
#
33
# Copyright (c) 2003 Martynas Sklyzmantas, Andrey Lebedev <[email protected]>
44
#
@@ -211,6 +211,9 @@ def create_version_2_tables(self):
211211
self.sql('''CREATE TABLE __words (_word VARCHAR(30),
212212
_textid INT) TYPE=%s'''%self.mysql_backend)
213213
self.sql('CREATE INDEX words_word_ids ON __words(_word)')
214+
self.sql('CREATE INDEX words_by_id ON __words (_textid)')
215+
self.sql('CREATE UNIQUE INDEX __textids_by_props ON '
216+
'__textids (_class, _itemid, _prop)')
214217
sql = 'insert into ids (name, num) values (%s,%s)'%(self.arg, self.arg)
215218
self.sql(sql, ('__textids', 1))
216219

roundup/backends/back_postgresql.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#$Id: back_postgresql.py,v 1.37 2006-11-09 00:55:33 richard Exp $
1+
#$Id: back_postgresql.py,v 1.38 2007-06-21 07:35:50 schlatterbeck Exp $
22
#
33
# Copyright (c) 2003 Martynas Sklyzmantas, Andrey Lebedev <[email protected]>
44
#
@@ -161,6 +161,9 @@ def create_version_2_tables(self):
161161
self.sql('''CREATE TABLE __words (_word VARCHAR(30),
162162
_textid integer)''')
163163
self.sql('CREATE INDEX words_word_idx ON __words(_word)')
164+
self.sql('CREATE INDEX words_by_id ON __words (_textid)')
165+
self.sql('CREATE UNIQUE INDEX __textids_by_props ON '
166+
'__textids (_class, _itemid, _prop)')
164167

165168
def fix_version_2_tables(self):
166169
# Convert journal date column to TIMESTAMP, params column to TEXT

roundup/backends/back_sqlite.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: back_sqlite.py,v 1.50 2006-12-19 03:01:37 richard Exp $
1+
# $Id: back_sqlite.py,v 1.51 2007-06-21 07:35:50 schlatterbeck Exp $
22
'''Implements a backend for SQLite.
33
44
See https://pysqlite.sourceforge.net/ for pysqlite info
@@ -144,6 +144,9 @@ def create_version_2_tables(self):
144144
self.sql('CREATE TABLE __words (_word varchar, '
145145
'_textid integer)')
146146
self.sql('CREATE INDEX words_word_ids ON __words(_word)')
147+
self.sql('CREATE INDEX words_by_id ON __words (_textid)')
148+
self.sql('CREATE UNIQUE INDEX __textids_by_props ON '
149+
'__textids (_class, _itemid, _prop)')
147150
sql = 'insert into ids (name, num) values (%s,%s)'%(self.arg, self.arg)
148151
self.sql(sql, ('__textids', 1))
149152

roundup/backends/rdbms_common.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
#$Id: rdbms_common.py,v 1.185 2007-04-11 20:04:06 forsberg Exp $
18+
#$Id: rdbms_common.py,v 1.186 2007-06-21 07:35:50 schlatterbeck Exp $
1919
""" Relational database (SQL) backend common code.
2020
2121
Basics:
@@ -2627,18 +2627,6 @@ def get(self, nodeid, propname, default=_marker, cache=1):
26272627
else:
26282628
return Class.get(self, nodeid, propname)
26292629

2630-
def getprops(self, protected=1):
2631-
"""In addition to the actual properties on the node, these methods
2632-
provide the "content" property. If the "protected" flag is true,
2633-
we include protected properties - those which may not be
2634-
modified.
2635-
2636-
Note that the content prop is indexed separately, hence no indexme.
2637-
"""
2638-
d = Class.getprops(self, protected=protected).copy()
2639-
d['content'] = hyperdb.String(indexme='yes')
2640-
return d
2641-
26422630
def set(self, itemid, **propvalues):
26432631
""" Snarf the "content" propvalue and update it in a file
26442632
"""

0 commit comments

Comments
 (0)