Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Hot answers tagged

3

It is much faster to iterate over an array then a recordset. You should also pass the recordset to a function to return the dictionary. The fewer tasks a subroutine performs the better. Function RecordsetMap(ByRef rs As ADODB.Recordset, ByVal KeyColumn As Long) As Scripting.Dictionary Dim Map As New Scripting.Dictionary Dim Key, Item, Values ...


3

Community wiki because the root of the answer (use an MLT to copy the data) was already in the comments. Shoutout to dnoeth and Der Kommissar for already explaining most of this in the comments. Kendra Little has a great article on this topic. In general, the ALTER TABLE statement can't be assumed to be minimally logged, in particular if it is a size-of-...


2

1. select Surname from Employee join Department on Department.Director = Employee.EmployeeId; Other than not requiring a subquery, this is generally a better thing to do because you can then easily access the matching Department table if you ever need to select a column from it. 2. Are you sure that this even works? You aren't joining the employee's ...


2

The query plan seems to be too complicated because all_constraint is a view and not table. So it's difficult to derive what it's doing. But from common sense it seems the optimal execution plan would be this: It first selects all ('P', 'U') records in the inner query For each of them finds correspondent 'R' records (with loop join) Filters and sorts what ...


1

CTEs A CTE is an optimization fence. You'll want to try to avoid it and at the least convert it into a subquery. Casting Do an explicit cast instead of an implicit cast: 0.00 + COUNT(*) becomes count(*)::real Between Rather than writing loan_loan.created_at > '2019-08-15' and loan_loan.created_at < '2019-09-05' write loan_loan....


Only top voted, non community-wiki answers of a minimum length are eligible