Forum Replies Created

Viewing 15 posts - 3,376 through 3,390 (of 49,552 total)

  • RE: Where Column IN (x,y,z) Better Than Where In (Select from table)

    In short, yes. The first it two seeks against the table (assuming appropriate indexes), the second is a join between two tables, might be a loop join, might not.

    The difference...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Restore Time on SQL Server 2016

    Not offhand, but you can get a quick and dirty check by copying large files from one say the backup drive to the data drive and see how long it...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Combining two qureies to one

    You're not going to get the desired output with a join, left or right.

    I don't know what bo universe is, If it accesses SQL server, can you put the code...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Restore Time on SQL Server 2016

    Version probably not much of a difference. Backup and restore are IO-bound operations. Test the kind of IO throughput you get on the VM, compare to the physical server.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Restore Time on SQL Server 2016

    Backup and restore times are mostly a function of IO throughput. Do the VMs and the physical server have the same IO capabilities?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Combining two qureies to one

    You can't just change an APPLY to a JOIN and expect the same results, you won't get them.

    An APPLY runs the query once for each row of the outer query,...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Cached Plans of Stored Procedure

    It's the plan 'shell' for the SELECT, it's not a complete plan. It's kinda a pointer to the parameterised form of the plan.

    http://daleburnett.com/2011/08/forced-parameterization/

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Varchar usage

    nadersam (3/30/2016)


    GilaMonster (3/30/2016)


    Varchar(max) is a very different data type. It's got additional overheads because it's off-row data, It's definitely not something you'd use on all columns.

    yes you are right off...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Varchar usage

    Varchar(max) is a very different data type. It's got additional overheads because it's off-row data, It's definitely not something you'd use on all columns.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Varchar usage

    Hugo Kornelis (3/29/2016)


    I am currently involved in several projects where data is converted from one system to another, and you won't believe the cr*p I encounter. City names in the...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Regarding extra space being used by Index after re-indexing

    Won't change things much. Rebuild still creates the new index and drops the old. The only thing that moves to TempDB is the sort space required.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: A GROUP BY rule

    Aggregate function.

    https://msdn.microsoft.com/en-us/library/ms173454.aspx

    GROUP BY isn't an aggregate, it's a clause in the statement that defines what columns the aggregates are computed by.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Convert string nvarchar(6) with format MMM-YY to date

    The first of the month.

    01-Jan-15 is a valid date. Jan-15 is not.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Convert string nvarchar(6) with format MMM-YY to date

    With a cast to DATE in the middle

    DECLARE @halfDate NVARCHAR(6) = 'Dec-15'

    SELECT DATEname(MONTH, CAST('01-'+@halfDate AS DATE)) + ' ' + CAST(YEAR(CAST('01-'+@halfDate AS DATE)) AS VARCHAR(4))

    Not sure if it's cleaner though.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: A GROUP BY rule

    Neither of those statements are true.

    Using AdventureWorks

    Valid:

    SELECT CustomerID, SUM(TotalDue) FROM Sales.SalesOrderHeader

    GROUP BY CustomerID, SalesOrderNumber, TerritoryID

    Valid:

    SELECT CustomerID, LEFT(SalesOrderNumber,5), SUM(TotalDue) FROM Sales.SalesOrderHeader

    GROUP BY CustomerID, SalesOrderNumber, TerritoryID

    Any column referenced in the...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 15 posts - 3,376 through 3,390 (of 49,552 total)