Most Popular
1500 questions
22
votes
3 answers
Safely moving and creating new tempdb files
Two things I'd like to know:
how do you safely move tempdb with minimal downtime?
how many tempdb files do you need?
Is it 1 file per core? So quad-core = 4 tempdb files, creating three new ones?
Stuart Blackler
- 4,540
- 7
- 30
- 43
22
votes
2 answers
How do you turn off the croak sound for Toad?
How do you turn off this annoying feature? I don't want my DB manager to croak at me as loud as it can.
NoBugsOnlyFeatures
- 323
- 2
- 7
22
votes
3 answers
SQL Server : How to disable trigger for an update only for your current session?
I am working on SQL Server 2008 R2.
I have a table benefit which has a AFTER INSERT, UPDATE trigger named tiu_benefit.
I want to write an UPDATE statement for this table to update 1 row but I dont want its trigger to fire. I know I can disable…
srh
- 323
- 1
- 2
- 5
22
votes
3 answers
Bad Practice to Store Calculated Data in Database?
Is it bad practice to store calculated data in each row, or is it better to calculate at the application layer with every read from the database.
Storing in the database avoids the need to calculate multiple times, but if an error is made then data…
Adam Thompson
- 459
- 1
- 4
- 11
22
votes
3 answers
SQL Server Distributed Availability Group databases not syncing after a server reboot
We're getting ready to perform a large upgrade on our SQL Servers and are noticing some unusual behavior with Distributed Availability Groups that I'm trying to resolve before moving forward.
Last month, I upgraded a remote secondary server from…
Taryn
- 9,746
- 4
- 48
- 74
22
votes
6 answers
SQL Server injection - how much damage in 26 chars?
I'm testing for resilience against injection attacks on an SQL Server database.
All table names in the db are lower case, and the collation is case-sensitive, Latin1_General_CS_AS.
The string I can send in is forced to uppercase, and can be a…
Alan B
- 417
- 4
- 11
22
votes
5 answers
Only one administrator can connect at this time (MS SQL Server error 18461)
I was experimenting the effect of giving SQL Server a small amount of memory I thought it was going to recover.
I configured SQL Server to use 200MB of memory now it does not want to start, I did some searches on the internet and I was advised to…
CodeWi
- 325
- 1
- 2
- 6
22
votes
3 answers
How can I use a full-text search on a jsonb column with Postgres?
So i have a jsonb column that has entries like this: https://pastebin.com/LxJ8rKk4
Is there any way to implement a full-text search on the entire jsonb column?
choco
- 221
- 1
- 2
- 4
22
votes
5 answers
Select multiple values in LIKE Operator
I have a SQL query given below, I want to select multiple value using like operator.
Is my Query correct?
SELECT top 1 employee_id, employee_ident, utc_dt, rx_dt
FROM employee
INNER JOIN employee_mdata_history
ON …
l.lijith
- 918
- 4
- 9
- 27
22
votes
2 answers
Dealing with disk space full in postgresql
I have a Django web application with postgresql 9.3.10 backend (sitting in a Linux OS). I ran into disk full error, such that even if I try to truncate a table, I get errors of the sort:
ERROR: could not extend file "base/30137/33186048": No space…
Hassan Baig
- 2,079
- 8
- 31
- 44
22
votes
3 answers
What index to use with lots of duplicate values?
Let's make a few assumptions:
I have table that looks like this:
a | b
---+---
a | -1
a | 17
...
a | 21
c | 17
c | -3
...
c | 22
Facts about my set:
Size of the whole table is ~ 1010 rows.
I have ~ 100k rows with value a in column a,…
foo
- 323
- 1
- 2
- 6
22
votes
3 answers
Separate month and year columns, or date with day always set to 1?
I'm building a database with Postgres where there's going to be a lot of grouping of things by month and year, but never by the date.
I could create integer month and year columns and use those.
Or I could have a month_year column and always set…
David N. Welton
- 323
- 1
- 2
- 6
22
votes
1 answer
datetime2(0) vs datetime2(2)
According to the documentation datetime2 (Transact-SQL):
Storage size
6 bytes for precisions less than 3.
7 bytes for precisions 3 and 4.
All other precisions require 8 bytes.
The size of datetime2(0), datetime2(1), datetime2(2) use the same…
Zapnologica
- 779
- 4
- 9
- 19
22
votes
2 answers
How to prevent statistics creation on a column?
I have a table with a column that I do not want statistics to be created or updated on. I get a better join cardinality estimate if I force the query optimizer to use density of statistics on the primary key as opposed to a statistics histogram on…
Joe Obbish
- 32,976
- 4
- 74
- 153
22
votes
1 answer
Clarification on MySQL innodb_flush_method variable
Let me begin by admitting that I'm very ignorant of the inner workings of hard disks. So when I read over the manual for the variable innodb_flush_method, it confused me. Can I get an explanation in layman's terms on the difference in O_DSYNC and…
Derek Downey
- 23,568
- 11
- 79
- 104