Most Popular
1500 questions
34
votes
1 answer
Guidelines for full-text index maintenance
What guidelines should be considered for maintaining full-text indexes?
Should I REBUILD or REORGANIZE the full-text catalog (see BOL)? What is a reasonable maintenance cadence? What heuristics (similar to the 10% and 30% fragmentation thresholds)…
Geoff Patterson
- 8,397
- 2
- 27
- 53
34
votes
4 answers
Is NOLOCK always bad?
I am a Report Developer who wants to make my queries as efficient as possible. I used to work with a DBA who told me - I believe because I was always dealing with reports on a Production Server - to use NOLOCK in every single query.
Now, I work…
DataGirl
- 465
- 4
- 6
33
votes
2 answers
Using EXCEPT in a recursive common table expression
Why does the following query return infinite rows? I would have expected the EXCEPT clause to terminate the recursion..
with cte as (
select *
from (
values(1),(2),(3),(4),(5)
) v (a)
)
,r as (
select a
from cte
…
Tom Hunter
- 2,159
- 3
- 16
- 11
33
votes
2 answers
PostgreSQL joining using JSONB
I have this SQL:
CREATE TABLE test(id SERIAL PRIMARY KEY, data JSONB);
INSERT INTO test(data) VALUES
('{"parent":null,"children":[2,3]}'),
('{"parent":1, "children":[4,5]}'),
('{"parent":1, "children":[]}'),
('{"parent":2, …
Kokizzu
- 1,363
- 6
- 17
- 34
33
votes
1 answer
Sample YAML Configuration Files for MongoDB?
The MongoDB configuration options documentation lists all the available options that can be specified, but does anyone have a set of fully formed example YAML formatted config files for MongoDB instances in various roles?
A set of examples for the…
Adam C
- 9,235
- 2
- 27
- 45
33
votes
3 answers
Efficient INSERT INTO a Table With Clustered Index
I have a SQL statement that inserts rows into a table with a clustered index on the column TRACKING_NUMBER.
E.G.:
INSERT INTO TABL_NAME (TRACKING_NUMBER, COLB, COLC)
SELECT TRACKING_NUMBER, COL_B, COL_C
FROM STAGING_TABLE
My question is - does it…
GWR
- 2,807
- 9
- 33
- 42
33
votes
1 answer
How to set up multiple fields as primary key in MySQL?
I have a table with fields
EmployeeID
blahblah
blahblah2
.....
RecordMonth
RecordYear
so each employee should only have a matching entry for a month, year, Emp#. How do I set up a table.
So how do I set up the table so that EmployeeID can be…
LOSTinDB
- 551
- 2
- 5
- 16
33
votes
5 answers