Merge lp://staging/~iffy/storm/lazycolumns into lp://staging/storm
Status: | Needs review |
---|---|
Proposed branch: | lp://staging/~iffy/storm/lazycolumns |
Merge into: | lp://staging/storm |
Diff against target: |
516 lines (+203/-44) 10 files modified
TODO (+0/-26) storm/expr.py (+8/-2) storm/info.py (+22/-0) storm/properties.py (+20/-6) storm/store.py (+37/-8) tests/info.py (+35/-1) tests/store/base.py (+70/-1) tests/store/mysql.py (+5/-0) tests/store/postgres.py (+3/-0) tests/store/sqlite.py (+3/-0) |
To merge this branch: | bzr merge lp://staging/~iffy/storm/lazycolumns |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Storm Developers | Pending | ||
Review via email: mp+87092@code.staging.launchpad.net |
Description of the change
Implemented the lazy-loading feature as described in the TODO file. Instead of having separate "lazy" and "lazy_group" arguments, however, I opted for just requiring "lazy" which can be one of the following:
- True: The column should be lazy all by itself.
- True-ish values: The column should be grouped with all other columns using this same value. If any of them are accessed, all of them are loaded.
Rationale: We need this to speed up access of our bad tables with huge text fields that are rarely used.
Unmerged revisions
- 431. By Matt Haggard
-
Added docstring for lazy attribute in expr.Column and removed laziness from the
TODO file - 430. By Matt Haggard
-
Lazy-loaded columns will not overwrite a previously set value.
- 429. By Matt Haggard
-
Finished lazy-loading of columns including some Store tests.
- 428. By Matt Haggard
-
Added lazy keyword as __init__ to Property and changed ClassInfo to
gather appropriate laziness information from that.
I'm glad you are working on this.
I have not done a full review at this point; I'd like to clarify
something though - it looks like you are making it so that all queries
will assume these columns are lazy. It is more efficient to grab the
column if needed in a single query rather than one-per-object. It
would be nice if users had the ability to control that.
For instance, say you have a changelog field in a table, which is a
big text field. Most pages in the website may not need it, but some
do. If its marked lazy, the pages that do need it will end up doing
(number of changelogs shown) separate queries to lazy-load the
changelog. If there is someway to say 'for this query, the changelog
field is needed', then that overhead can be eliminated.
And, if we have such a way to force laziness- into-eagerness, we
probably can do the reverse trivially - force eagerness into laziness
to prevent a bunch of fields being loaded on a query by query basis.
What do you think?
-Rob