         "SELECT -1 AS id, guid, type, is_deleted, parentid, parentName, feedUri, pos, title, bmkUri, folderName, faviconID " +
         "FROM \(TableBookmarksLocal) WHERE is_deleted IS NOT 1"
 
+        // We exclude queries and dynamic containers, because we can't
+        // usefully display them.
+        let typeQuery = BookmarkNodeType.Query.rawValue
+        let typeDynamic = BookmarkNodeType.DynamicContainer.rawValue
+        let typeFilter = " vals.type NOT IN (\(typeQuery), \(typeDynamic))"
 
         let args: Args
         let exclusion: String
         if let excludingGUIDs = excludingGUIDs {
             args = ([parentGUID, parentGUID, parentGUID] + excludingGUIDs).map { $0 as AnyObject }
-            exclusion = "WHERE vals.guid NOT IN " + BrowserDB.varlist(excludingGUIDs.count)
+            exclusion = "\(typeFilter) AND vals.guid NOT IN " + BrowserDB.varlist(excludingGUIDs.count)
         } else {
             args = [parentGUID, parentGUID, parentGUID]
-            exclusion = ""
+            exclusion = typeFilter
         }
 
         let fleshed =

            switch type {
            case .Bookmark:
                return itemFactory(row)
            case .Folder:
                return folderFactory(row)
            case .DynamicContainer:
                fallthrough
            case .Separator:
                return separatorFactory(row)
            case .Livemark:
                return livemarkFactory(row)
            case .Query:
                return queryFactory(row)
            }
        }

        "       structure.parent AS _parent " +
        "FROM (\(either)) AS structure JOIN (\(values)) AS vals " +
        "ON vals.guid = structure.guid " +
        "WHERE " + exclusion

        let withIcon =
        "SELECT bookmarks.id AS id, bookmarks.guid AS guid, bookmarks.type AS type, " +
