id summary reporter owner description type status component version severity resolution keywords cc stage has_patch needs_docs needs_tests needs_better_patch easy ui_ux 5030 Remove COUNT(*) aggregate from model.save() when determining whether row exists zigiDev@… Adrian Holovaty "Currently, the save method of the Model object uses an aggregate function to determine if a row with the specified primary key already exists. However, we don't need to know the count just whether the row exists or not. An alternative is to just simply SELECT 1 so if the row exists it will return 1, and if not we get a null. On PostgreSQL the COUNT(*) version takes over twice as long as the SELECT 1 version (''it's not that significant but it is unnecessary work''). Patch attached. " closed Database layer (models, ORM) dev fixed model save Ready for checkin 1 0 0 0 0 0