I don't see any difference in the runtimes, at least not with the current head 
of trunk ...

sqlite> .once x
sqlite> select * from invoices;
Run Time: real 0.032 user 0.031250 sys 0.000000
sqlite> .once y
sqlite> SELECT ShipName, ShipAddress, ShipCity, ShipRegion, ShipPostalCode, 
ShipCountry, Orders.CustomerID as CustomerID, Customers.CompanyName, 
Customers.Address, Customers.City, Customers.Region, Customers.PostalCode, 
Customers.Country,
   ...> Employees.[FirstName] || ' ' || Employees.[LastName] AS Salesperson,
   ...> Orders.OrderID as OrderID, OrderDate, RequiredDate, ShippedDate,
   ...> Shippers.CompanyName, Products.ProductID as ProductID, ProductName, 
[Order Details].UnitPrice as UnitPrice, Quantity, Round(Discount,4) as 
DisCount, Round([Order Details].UnitPrice * Quantity * (1-Discount), 2) AS 
ExtendedPrice, Freight FROM
   ...> Orders INNER JOIN Customers ON Orders.CustomerID = Customers.CustomerID
   ...>            INNER JOIN Employees ON Employees.EmployeeID = 
Orders.EmployeeID
   ...>            INNER JOIN [Order Details] ON Orders.OrderID = [Order 
Details].OrderID
   ...>            INNER JOIN Products ON Products.ProductID = [Order 
Details].ProductID
   ...>            INNER JOIN Shippers ON Shippers.ShipperID = Orders.ShipVia
   ...> Order By OrderID;
Run Time: real 0.031 user 0.031250 sys 0.000000
sqlite>


sqlite> .once x
sqlite> SELECT * FROM Products JOIN [Order Details] Using(ProductID)
   ...> Order By OrderID
   ...> ;
Run Time: real 0.015 user 0.015625 sys 0.000000
sqlite> .once y
sqlite> Select * From [Order Details Extended] ;
Run Time: real 0.016 user 0.015625 sys 0.000000
sqlite>




---
The fact that there's a Highway to Hell but only a Stairway to Heaven says a 
lot about anticipated traffic volume.


>-----Original Message-----
>From: sqlite-users [mailto:sqlite-users-
>boun...@mailinglists.sqlite.org] On Behalf Of Olaf Schmidt
>Sent: Friday, 27 October, 2017 12:21
>To: sqlite-users@mailinglists.sqlite.org
>Subject: [sqlite] Small Performance Regression (3.21.0)
>
>The new CoRoutine-approach seems to slow down certain
>ViewDefinitions (in comparison to running a Query directly).
>
>FWIW, here's a download-link to an NorthWind-SQLite-DB, which
>already contains certain view-definitions:
>http://vbRichClient.com/Downloads/NWind.zip
>(an "Analyze"-command was already run against that DB).
>
>The one view-def (where the difference is most apparent) is
>[Invoices]:
>
>Here a: Select * From Invoices
>needs about 20msec.
>
>Whereas running the SQL of the View-definition directly,
>needs only about 10msec.
>
>A simpler view-definition in the above zipped NWind.db is:
>[Order Details Extended]
>
>Which is defined with the following SQL:
>SELECT * FROM Products JOIN [Order Details] Using(ProductID)
>Order By OrderID
>
>When run directly, it comes up with the result after ~4msec,
>whereas: Select * From [Order Details Extended] needs ~6msec.
>
>Using Explain, it showed that in case we run against the
>ViewNames, the CoRoutine-approach was present, whereas when
>running the SQL directly (and faster), the CoRoutine-preparation
>was absent from the Explain-Output...
>
>No biggie here so far - but reporting the behaviour early seemed
>like a good idea to me...
>
>Kind Regards,
>
>Olaf
>
>
>_______________________________________________
>sqlite-users mailing list
>sqlite-users@mailinglists.sqlite.org
>http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users



_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to