We have moved to Github. Please open tickets there.

#3674 closed Defect (duplicate)

entity constructors are inefficient

Reported by: ewinslow Owned by:
Priority: normal Milestone: Needs Review
Component: Core Version: 1.7
Severity: major Keywords:
Cc: brett@… Difficulty: difficult

Description

When a row is provided to the entity constructor, it ignores the contents and proceeds to fetch the row from the database using the GUID. This is highly inefficient, especially during an elgg_get_entities call. When returning 10 entities, this results in at least 21 queries (1 to fetch the entities, 10 to re-fetch the entity rows, and 10 more for each of the type-specific rows).

We should just use the given row to initialize the entity, and only fetch what we *don't* already have from the database.

Change History (2)

comment:1 Changed 23 months ago by cash

comment:2 Changed 23 months ago by ewinslow

  • Resolution set to duplicate
  • Status changed from new to closed

hmmm... indeed.

Note: See TracTickets for help on using tickets.