Skip to content

Commit

Permalink
Improve documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
pprkut committed Dec 2, 2018
1 parent 747fbea commit 0f6a38f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions beets/dbcore/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
from .query import MatchQuery, NullSort, TrueQuery
import six


class DBAccessError(Exception):
"""The SQLite database became inaccessible.
Expand Down Expand Up @@ -562,9 +563,7 @@ def _get_objects(self):
first.
"""

# First fetch all flexible attributes for all items in the result.
# Doing the per-item filtering in python is faster than issuing
# one query per item to sqlite.
# Index flexible attributes by the item ID, so we have easier access
flex_attrs = self._get_indexed_flex_attrs()

index = 0 # Position in the materialized objects.
Expand Down Expand Up @@ -908,7 +907,9 @@ def _fetch(self, model_cls, query=None, sort=None):
"ORDER BY {0}".format(order_by) if order_by else '',
)

# Fetch flexible attributes for items matching the main query
# Fetch flexible attributes for items matching the main query.
# Doing the per-item filtering in python is faster than issuing
# one query per item to sqlite.
flex_sql = ("""
SELECT * FROM {0} WHERE entity_id IN
(SELECT id FROM {1} WHERE {2});
Expand Down

0 comments on commit 0f6a38f

Please sign in to comment.