From e6f9811162c60c111499c8e920783bb0ea8abca2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Tue, 2 Aug 2016 09:00:59 +0200 Subject: [PATCH] Performance tips --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 453b18c96..fabd56d00 100644 --- a/README.md +++ b/README.md @@ -3570,8 +3570,7 @@ Instead, perform *a single query*: let sql = "SELECT authors.*, COUNT(books.id) AS bookCount " + "FROM authors " + "LEFT JOIN books ON books.authorId = authors.id " + - "GROUP BY authors.id " + - "ORDER BY authors.name" + "GROUP BY authors.id" let authors = Author.fetchAll(db, sql) ``` @@ -3623,7 +3622,7 @@ for person in Person.fetch(db) { // Column indexes // SELECT id, name, email FROM persons let request = Person.select(idColumn, nameColumn, emailColumn) -for row in Row.fetch(db, request).map { +for row in Row.fetch(db, request) { let id: Int64 = row.value(atIndex: 0) let name: String = row.value(atIndex: 1) let email: String = row.value(atIndex: 2)