TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
David Smith
NA
2k
0
SQL Performance Query Speed up; Million Records
Feb 22 2012 5:32 AM
There are a million records in table.
How to speed up query, it takes two 3mins to process this one query.
ALTER PROCEDURE [
dbo
].[prc_GetDistinctConcatStringColorUnitsOnly]
AS
BEGIN
IF OBJECT_ID ('dbo.CONCAT_COLOR_UNITS_ONLY', 'U') IS NOT NULL
DROP TABLE dbo.CONCAT_COLOR_UNITS_ONLY;
select distinct ([COLOR].[TEST_SET_IDENTIFICATION] + ' ' +
[COLOR].[IDENTIFICATION] + ' ' +
[COLOR].[SERIAL_NUMBER] + ' ' +
[COLOR].[PART_NUMBER] + ' ' +
[COLOR].[CODE]) AS CONCAT, *
into dbo.CONCAT_COLOR_UNITS_ONLY
FROM dbo.COLOR
where SERIAL_NUMBER not like ('%[^0123456789]]%' )and LEN(SERIAL_NUMBER)= 6 and SERIAL_NUMBER NOT LIKE '%[A-Z]%' and COLOR_CATEGORY not like 'RED'
END
Reply
Answers (
3
)
SQL Trigger and Oracle Trigger
Database consistency check