while looking into it - was there a reason for you to build a heap with columnstore indexes instead of making one of them a clustered columnstore index?
April 11, 2022 at 4:12 am
while looking into it - was there a reason for you to build a heap with columnstore indexes instead of making one of them a clustered columnstore index?
This is a great question. I am rookie. I know basics on writing SQL but have no clue on anything else. If I made a mistake in setting up index please let me know how I can fix it. Sorry for the rookie mistakes.
April 11, 2022 at 5:11 am
while looking into it - was there a reason for you to build a heap with columnstore indexes instead of making one of them a clustered columnstore index?
the query i have created has multiple sub-components and those are put into temp tables. for each temp table i create, i also create an index for it. below is a typical one:
--Create indexes
CREATE NONCLUSTERED COLUMNSTORE INDEX [MyIndex] ON [dbo].[tblExpiration]
(
[SYMBOL1],
[DATE],
[EXPIRATION]
)WITH (DROP_EXISTING = ON, COMPRESSION_DELAY = 0) ON [PRIMARY]
i am not super experienced with this. is this the correct way to do it? should i be using non-clustered? or should i be using clustered?
there are multiple columns i use throughout the script so i need those columns to be indexed. to my simple brain i think i need columnstore index but not sure whether it should be clustered or not.
April 11, 2022 at 5:35 am
another question...
the execution plan says to create a non-clustered index on main table with the suggested fields:
Missing INdex (Impact 41.8205): Create Nonclustered index [<Name of missing index, sysname,>] on dbo.MyDB ([Column1], [Column2]) include ([Column3)
i added this index with noted fields but it still says the same message. do you know why it is saying this?
April 11, 2022 at 7:14 am
instead of having all your tables as heap and with additional non clustered indexes (columnstore or not) try and make one of them a clustered columnstore (or a normal clustered index).
using columnstore vs normal clustered index depends on the usage given to the data - columnstore are good for aggregation queries - but bad for updates/deletes and some times also bad for queries that just do select the data without aggregating.
for the recommended indexes - many times they should be ignored - but they can be a pointer that some indexes may be required - not always and many times not worth it at all at least the way the adviser suggests.
April 11, 2022 at 9:46 pm
instead of having all your tables as heap and with additional non clustered indexes (columnstore or not) try and make one of them a clustered columnstore (or a normal clustered index).
using columnstore vs normal clustered index depends on the usage given to the data - columnstore are good for aggregation queries - but bad for updates/deletes and some times also bad for queries that just do select the data without aggregating.
for the recommended indexes - many times they should be ignored - but they can be a pointer that some indexes may be required - not always and many times not worth it at all at least the way the adviser suggests.
Most of my queries are a combination of select and group by so looks like columnstore is the way to go.
Thank you so much for your help on this! I appreciate it very much!!
April 12, 2022 at 12:47 am
Even with the columnstore thing, the original issue on this thread has never been solved. What made the old query suddenly perform so poorly when the database was moved to the new system? And what else is going to leave streak marks in the bed?
--Jeff Moden
Change is inevitable... Change for the better is not.
April 12, 2022 at 5:51 am
Even with the columnstore thing, the original issue on this thread has never been solved. What made the old query suddenly perform so poorly when the database was moved to the new system? And what else is going to leave streak marks in the bed?
agreed.
not sure what happened. i suspect (not certain) that the indexes got corrupted somehow when the move happened. as soon as the index was re-created the performance improved and got better. the most important thing for now is that the performance is significantly improved. why it degraded is the a thing of the past.
Viewing 10 posts - 31 through 39 (of 39 total)
You must be logged in to reply to this topic. Login to reply