Use full, not partial index for history.
historyContains includes redirect urls, so we actually don't want a partial index here.
This commit is contained in:
parent
478a719f77
commit
ea0b3eee05
@ -78,7 +78,7 @@ class WebHistory(sql.SqlTable):
|
||||
def __init__(self, parent=None):
|
||||
super().__init__("History", ['url', 'title', 'atime', 'redirect'],
|
||||
parent=parent)
|
||||
self.create_index('HistoryIndex', 'url', where='not redirect')
|
||||
self.create_index('HistoryIndex', 'url')
|
||||
self._contains_query = self.contains_query('url')
|
||||
self._between_query = sql.Query('SELECT * FROM History '
|
||||
'where not redirect '
|
||||
|
@ -123,16 +123,15 @@ class SqlTable(QObject):
|
||||
# pylint: disable=invalid-name
|
||||
self.Entry = collections.namedtuple(name + '_Entry', fields)
|
||||
|
||||
def create_index(self, name, field, where):
|
||||
def create_index(self, name, field):
|
||||
"""Create an index over this table.
|
||||
|
||||
Args:
|
||||
name: Name of the index, should be unique.
|
||||
field: Name of the field to index.
|
||||
where: WHERE clause for a partial index.
|
||||
"""
|
||||
q = Query("CREATE INDEX IF NOT EXISTS {} ON {} ({}) WHERE {}"
|
||||
.format(name, self._name, field, where))
|
||||
q = Query("CREATE INDEX IF NOT EXISTS {} ON {} ({})"
|
||||
.format(name, self._name, field))
|
||||
q.run()
|
||||
|
||||
def __iter__(self):
|
||||
|
Loading…
Reference in New Issue
Block a user