-
Table with 6 billion rows - WHERE on an non-indexed column
I have a huge table with 6 billion rows.
The columns in the table are Field1, field2...
Field1 contains data in the format of 'Arguments=Value1|Value2|Value3|Value4|Value5'
Filed1 in the table is not indexed.
I need to select from this table based on a specific value of Value 3.
SELECT *
FROM tablename E (nolock)
WHERE
CASE
WHEN charindex('|',E.field1)+1 > 0 AND CHARINDEX('|', E.field1, CHARINDEX('|', E.field1)+1) - charindex('|',E.field1) -1 > 0
THEN substring(E.field1,charindex('|',E.field1)+1,CHARI NDEX('|', E.field1,CHARINDEX('|', E.field1)+1) - charindex('|',E.field1) -1)
ELSE '0'
END in ('2401072700','2264935814');
May I know if this SQL is OK to be run?
Will the transaction log file grow enormously as the query is running?
What might the other issues which i need to take care of?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|