[tracker/tracker-0.6] Removed unnecessary DISTINCT in GetByServiceType
- From: Ivan Frade <ifrade src gnome org>
- To: svn-commits-list gnome org
- Subject: [tracker/tracker-0.6] Removed unnecessary DISTINCT in GetByServiceType
- Date: Tue, 16 Jun 2009 11:01:34 -0400 (EDT)
commit 845ce60eb340e7de233986228cb8d3b436d4278d
Author: Ivan Frade <ivan frade nokia com>
Date: Tue Jun 16 17:58:08 2009 +0300
Removed unnecessary DISTINCT in GetByServiceType
GetByServiceType is retrieving the files using SELECT DISTINCT, but
it is not possible to have duplicated files in the DB. Removing the
"DISTINCT" makes the query quite faster.
data/db/sqlite-stored-procs.sql | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/data/db/sqlite-stored-procs.sql b/data/db/sqlite-stored-procs.sql
index 2d50330..45f7762 100644
--- a/data/db/sqlite-stored-procs.sql
+++ b/data/db/sqlite-stored-procs.sql
@@ -47,7 +47,7 @@ DeleteServiceKeywordMetadata DELETE FROM ServiceMetaData WHERE ServiceID = ?;
DeleteServiceNumericMetadata DELETE FROM ServiceMetaData WHERE ServiceID = ?;
GetServiceID SELECT ID, IndexTime, IsDirectory, ServiceTypeID, Enabled FROM Services WHERE Path = ? AND Name = ?;
-GetByServiceType SELECT DISTINCT S.Path || '/' || S.Name AS uri FROM Services AS S WHERE S.Enabled = 1 AND (S.AuxilaryID = 0 OR S.AuxilaryID IN (SELECT VolumeID FROM Volumes WHERE Enabled = 1)) AND S.ServiceTypeID IN (SELECT TypeId FROM ServiceTypes WHERE TypeName = ? OR Parent = ?) LIMIT ?,?;
+GetByServiceType SELECT S.Path || '/' || S.Name AS uri FROM Services AS S WHERE S.Enabled = 1 AND (S.AuxilaryID = 0 OR S.AuxilaryID IN (SELECT VolumeID FROM Volumes WHERE Enabled = 1)) AND S.ServiceTypeID IN (SELECT TypeId FROM ServiceTypes WHERE TypeName = ? OR Parent = ?) LIMIT ?,?;
GetContents SELECT uncompress (Content) FROM ServiceContents WHERE ServiceID = ? AND MetadataID = ? AND Content is not null;
GetFileContents SELECT substr(uncompress (Content), ?, ?) FROM ServiceContents WHERE ServiceID = ?;
GetAllContents SELECT uncompress (Content) FROM ServiceContents WHERE ServiceID = ? AND Content is not null;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]