Viewing 15 posts - 1,141 through 1,155 (of 7,608 total)
This is not going to allow index usage in the join: AND KeyValue = (co.co_num + '-' + CAST(coitem.co_line AS VARCHAR(10)) + '-0' )
SQL can use an index for...
November 6, 2021 at 5:03 am
fake_pointer ???? NOT NULL);
The reason you are using big integers is because they look like pointers. But we don’t use pointers in RDBMS. You’re using SQL to write assembly...
November 6, 2021 at 4:59 am
As a bit of a sidebar, wouldn't adding more files add to the problem you spoke of previously?
I'm not sure which specific "problem" you're referring to.
November 6, 2021 at 4:52 am
But when Jonathon added both columns the WHERE clause, it might have taken care of it.
c.CustomerNumber = t.CustomerNumber AND c.Customer = t.Customer
Jonathon, your second query brought the spool back. ...
November 5, 2021 at 4:29 pm
Agreed, the NOLOCK was already on my radar.
Removing NOLOCK would only slow down the process, never speed it up. I'm not saying you should or shouldn't use it here...
November 5, 2021 at 3:16 pm
I don't understand what you are trying to do or your data. But I think the part:
Bank = (Select Bank From Customer Where Customer=t.Customer)is redundant.
I'm not...
November 5, 2021 at 3:14 pm
What indexes do you have on that table?
Looks like an index on ( MessageType, NewValue, KeyValue, RecordDate ) INCLUDE ( CreateDate, OldValue )
might be useful for this query.
November 5, 2021 at 2:54 pm
You're presuming an awful lot. Why would you want "at least 2 files per filegroup" for a single table?
To spread the I/O out, the typical reason for multiple files...
November 4, 2021 at 6:27 pm
I still have to think about this. We have hundreds of dbs. Say anywhere from 3 to 24 large tables in each db, a separate fg for each. Presumably you'd...
November 4, 2021 at 4:12 pm
{Thousands of recompiles a day} vs {thousands of extra table scans a day} is an easy choice. I'd have to see actual damage from the recompiles to recommend...
November 4, 2021 at 3:49 pm
Of course that forces the entire table to be rewritten every time. In a typical rebuild, often large parts of the table do not need rewritten because they...
November 4, 2021 at 2:58 pm
I'll have to think about that method some more, don't have time right now.
November 4, 2021 at 2:47 pm
{Thousands of recompiles a day} vs {thousands of extra table scans a day} is an easy choice. I'd have to see actual damage from the recompiles to recommend differently. Partly...
November 4, 2021 at 2:45 pm
So OP does in their next post.
OK. I might still stick with recompile on this. It's returning only a single int column and the controlling columns (in the WHERE clause)...
November 3, 2021 at 9:49 pm
Just one more thing... The example above spans 29 months. Is there a good way to separate it out to place three columns for each month within the date...
November 3, 2021 at 8:16 pm
Viewing 15 posts - 1,141 through 1,155 (of 7,608 total)