ironic/ironic/db
Julia Kreger 644ba5d4bc Only return the requested fields from the DB
A node object has many fields, and a huge opportunity
for performance improvement is to reduce the amount of work
performed at the lower layers when it is not necessary.
In particular, the easiest case to identify and handle is
when a list of fields to be fulfilled is explicitly supplied.

This is particularlly noteworthy when we collecting a list of
nodes for synconization with Nova, where only 9 columns are
really needed to supply Nova with the information required,
and thus numerous fields are discarded.

This is all particularlly compounded when traits are used,
which presently uses a joined load pattern from SQL.

With this patch, we explicitly load and convert only the fields
requested at the lowest level, and then perform a different style
of loading node traits which requires less overhead by SQLAlchemy
to de-duplicate the returned result set to the application.

This turns out to be far more efficent as we're reducing the amount
of data/object conversion work by 360%, even before we consider
populating traits, which is performed as a separate query when
traits are requested.

Story: 2008885
Task: 42434
Change-Id: Iac703d2a9b7b240a47477be8a64c7c33e28f692f
2021-06-25 06:14:39 -07:00
..
sqlalchemy Only return the requested fields from the DB 2021-06-25 06:14:39 -07:00
__init__.py Remove copyright from empty files 2014-01-07 21:05:01 +08:00
api.py Only return the requested fields from the DB 2021-06-25 06:14:39 -07:00
migration.py Remove downgrade support from migrations 2016-02-08 15:31:15 +00:00