Forum Replies Created

Viewing 15 posts - 44,656 through 44,670 (of 49,552 total)

  • RE: select statement with order by

    Gary Johnson (9/5/2008)


    mj obi-wan kenobi (9/5/2008)


    Pretty strange behavior in 2k5...

    Not really.

    In query 1, because the expression in the order by is qualified with the table, it's clearly not a...

    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: DBCC DBREINDEX / DBCC SHRINKFILE

    I'm assuming this table has a clustered index?

    You can drop and recreate the clustered index and specify the new location on another filegroup. Then go and shrink the file...

    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: Index Seek vs Index Scan

    It won't. All the versions of showplan show the same data, just the methods of storing and showing it change.

    Look at the seek predicates. If you've got a partial scan,...

    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: if.. else if.. else performance issues

    Possibly parameter sniffing. When the optimiser compiles the proc, it will optimise the queries based on the current parameter values, and it will optimise all queries in the proc, regardless...

    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: Odd Construct in a WHERE clause

    Ok, with 3 columns, populated much the same way as the first. I interleaved the queries to make it as equal as possible

    set statistics time on

    go

    DECLARE @param char(1), @param1 char(1),...

    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 with no backup

    After switching to simple, run a checkpoint. It's the checkpoint that triggers log truncation in simple recovery.

    Make very, very sure you take a full backup after switching back to full...

    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: Cannot shrink data file sql 2005 sp2

    Is there space free within the data file? What does the following return?

    exec sp_spaceused

    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: Index Seek vs Index Scan

    Jack Corbett (8/4/2008)


    while searching on a range (column between a and b) will get a scan.

    If either the start or the end of the range is sargable, a range...

    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: Will index sequence help in sequence of WHERE caluse?

    jluniya (9/5/2008)


    So does it mean, the index sequence can be decided on any order? Or is there any logic to decide the index ordering?

    There is, and it depends on 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: Cannot shrink data file sql 2005 sp2

    When you say 'can't shrink' do you mean it's giving you an error?

    Why are you shrinking the data and log files anyway?

    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: DBCC DBREINDEX / DBCC SHRINKFILE

    Kenneth Fisher (9/5/2008)


    As a test I ran DBCC SHOWCONTIG right after the DBREINDEX and got less than 1% fragmentation. Then I ran my SHRINKFILE, then the SHOWCONTIG again. ...

    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 with no backup

    Vika (9/5/2008)


    And another question. If log is full and so huge that there is no space to back it up, would it help to shrink it first and then back...

    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: Odd Construct in a WHERE clause

    Glen (9/5/2008)


    And shouldn't the variation of "100 ms" in execution be random ?

    In the test I posted the variations were indeed completely random. I'll test later with a couple of...

    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: SQL profiler trace result analysis

    You can load the traces into a SQL table (profiler -> save to table or fn_trace_gettable) and then you can query them in SQL. Easier than analysing in profiler.

    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: Error: 7105, Severity: 22, State: 6

    Database corruption. Do you have an up-to-date backup?

    Please run the following and post the output.

    DBCC CHECKDB ( < Database name > ) WITH NO_INFOMSGS

    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 - 44,656 through 44,670 (of 49,552 total)