4
votes
6answers
1k views

Does SQL Server execute queries in parallel?

Does SQL Server execute queries in parallel? In other words, if I run a heavy query that takes 10 seconds to execute, and at the same time start another heavy query that takes 10 seconds, will the ...
2
votes
1answer
2k views

Ubuntu Multiple MySQL instances and Apparmor

I am trying to set up multiple instances of MySQL on an Ubuntu dev machine and running into AppArmor problems. I get this error in the syslogs: kernel: [227631.776360] type=1400 ...
18
votes
5answers
6k views

SQL: What is slowing down INSERTs if not CPU or IO?

We have a database for a product that is write-heavy. We just bought a new server machine with a SSD to help. To our surprise, the insertions were not faster than on our old machine with much slower ...
7
votes
1answer
1k views

Is there a way to force Deferred Name Resolution even if the table exists when creating a sproc?

When creating a Stored Procedure in SQL Server you are allowed to refer to tables which do not exist. But, if the table does exist then any column you refer to in the procedure must exist in that ...
1
vote
1answer
659 views

Send SSRS Report Many Times Based on Sql Query

I have a user who is requesting that a legacy report (email subscription) that runs with multiple categories be modified to run based on which categories exist in the given date range. Thus instead of ...
5
votes
2answers
815 views

How to sync a database with an external full text engine?

How do you keep your external full-text engine (Lucene, Solr, etc) in sync with your database data? For example, keeping track of inserts, deletes, updates. My current solution involves a big union ...
1
vote
2answers
186 views

What's the best way to ensure referential integrity on a replicated database?

Using SQL SERVER 2005, I have a couple of questions on Replication and referential integrity. 1) Does Replication handle referential integrity? 2) If I do an Insert to Parent table and then to ...
2
votes
1answer
313 views

Displaying parent attributes alongside child attributes

SSAS - Parent Child hierarchy - displaying other Parent attributes alongside Child Attributes For example: Employee Table +-----+-------+------+---------------+ | KEY | NAME | ROLE | MANAGERKEY ...
2
votes
2answers
273 views

Can I query a copy of a database without impacting performance of the primary?

I am working with a partner who has a large (150,000,000 records and growing) MSSQL database. They query and populate the database with proprietary software which I cannot easily influence. I would ...
2
votes
1answer
305 views

SSAS Dimension Help - Finding Values Not In the Dimension using Role Playing

I have a Fact / Fact Less table that has a list of Products likley to be purchased by client. Client ID Product ID 1 1 1 2 2 2 2 5 etc... I need to to allow ...
1
vote
1answer
2k views

SQLSTATE[HY000]: General error: 1025 Error on rename of

I'm getting this error: SQLSTATE[HY000]: General error: 1025 Error on rename of './salt/ghost' to './salt/#sql2-4ab-630b' (errno: 152). Failing Query: "ALTER TABLE ghost DROP FOREIGN KEY ...
11
votes
2answers
5k views

INSERT performance difference between temporary tables and table variable

I have the following issue in SQL Server 2005: trying to inserts some rows into a table variable takes a lot of time compared to the same insert using a temporary table. This is the code to insert ...
26
votes
3answers
20k views

Most idiomatic way to implement UPSERT in Postgresql nowadays

I've read about different UPSERT implementations in PostgreSQL, but all of these solutions are relatively old or relatively exotic (using writeable CTE, for example). And I'm just not a psql expert ...
2
votes
1answer
836 views

Index physical stats DMV - Object ID/table not found

I have installed SQL Server 2012 RC0 on my laptop recently and I was trying a demo which illustrates how shrink database will cause fragmentation. I created a table, a clustered index on the identity ...
10
votes
4answers
1k views

How to store data in a database without tables?

All I learned in school was SQL which saves data to tables. Right now I am working on a project where data is stored in XML-files. Additionally every XML contains a reference to visual files (JPEG). ...
3
votes
2answers
307 views

SQL Data aggregation

I have a problem with sql data aggregation problem.here is the sample sql.I am using oracle database. select pm.city cityid, to_char(pm.sampledate, 'yyyy-MM') timepoint, count(distinct me.id) ...
8
votes
3answers
539 views

Would it be considered as a bad practice to have multiple nullable FKs on a table in SQL Server

On my database structure in SQL Server, I have 3 types of products which requires different information about the order. So, I created one Customers table and three different orders tables: ...
10
votes
7answers
15k views

slow load speed of data from mysqldump

I've got a moderate size MySQL database with about 30 tables, some of which are 10 million records, some 100 million. The mysqldump of all the tables (into separate files) is fairly fast, takes maybe ...
1
vote
2answers
314 views

Installing SQL Server 2008 R2 Service Pack 1

I have SQL Server 2008 R2 installed on my computer. I want to install Service Pack 1 for SQL Server 2008 R2. Do I need to select upgrade option or new installation during installation of service pack ...
1
vote
2answers
3k views

MS SQL Server - update row value to next row with row id

I have a table like below: Newid1 a b c 1 null 40 50 2 null 45 55 3 null 46 56 4 null 47 57 5 null 48 58 Now I want to update value ...
3
votes
1answer
159 views

update with nested join problem

First of all newbie here and to the world of Oracle, just trying to get some code working: UPDATE CUSTOMERS SET RE.LASTNAME = 'NO REFERRAL' WHERE RE.LASTNAME IS NULL (SELECT CU.CUSTOMER#, ...
1
vote
1answer
273 views

Sending SQL Server query as CSV via e-mail

Currently I'm using SSIS w/ a hacky solution to get around it not supporting auth on SMTP servers. Is there a better way I can save a query to a CSV file, then mail it as an attachment? Thanks
1
vote
1answer
1k views

Screwed up MySQL init_connect

I executed an incorrect SQL command: SET GLOBAL init_connect='SET CHARACTER SET=utf-8'; Now, when I try and run a script that connects to this database, I get the following error: ...
3
votes
1answer
3k views

How do I update a table with the aggregted values (min, max) of a related table, fast?

I have a table create table w ( id integer primary key, -- min_xyz double, max_xyz double, min_abc double, max_abc double ); with the min* and max* values currently being null. I have ...
3
votes
1answer
63 views

Do SQL Server disabled databases cause any usage concerns?

I have a SaaS e-commerce app. When clients stop using the service I disable their SQL Server Database and User Account rather than delete them. Do these disabled databases cause any concerns related ...
4
votes
2answers
233 views

Can I be notified of a rollback in my DDL Trigger?

I'd like DDL changes in SQL Server to trigger an external process (outside of SQL). The problem is, is there a way for me to be notified via my trigger that a rollback occurred? For instance, with ...
4
votes
1answer
220 views

Need to find duplicate entries

I received a database with a few million records in it, but apperently there might be duplicate records in them. A user enters data into the database and a primary key is generated, however if the ...
1
vote
2answers
270 views

How to recover previous values in Mysql Table?

I have MySQL Innodb table of 14M rows. There was a column called is_disabled which had different values. By mistake I ran the query without the where clause: update url_queue set is_disabled=1 ...
1
vote
1answer
269 views

What is the difference between setting the directive default-character-set under [client] as opposed to [mysqld]?

Reference: http://stackoverflow.com/a/8690422/784637 Correct me if I'm wrong, but the best answer suggests a way to force everything being inputted into the database to be encoded in utf-8 and ...
22
votes
1answer
6k views

Why is using a table variable more than twice as fast as a #temp table in this specific case?

I was looking at the article here Temporary Tables vs. Table Variables and Their Effect on SQL Server Performance and on SQL Server 2008 was able to reproduce similar results to those shown there for ...
1
vote
1answer
549 views

Can I use the “import” tool on PHPMyAdmin multiple times?

I am moving databases between a couple of shared hosting accounts, and both of them only give access to the MySQL databases through phpmyadmin. The importing account's upload limit is 50MB. I would ...
8
votes
3answers
2k views

Insert if not exists, concurrently

I am having concurrency issues with my inserts in a stored procedure. The relevant part of the procedure is this: select @_id = Id from table1 where othervalue = @_othervalue IF( @_id IS NULL) BEGIN ...
0
votes
3answers
138 views

What should I use as a primary key/index for a table with no unique columns that are mostly written to?

I have a table on a SQL server database that stores logging information about various user activity. Date/time, user id, and a few columns that specify where and what was done. None of this data is ...
1
vote
2answers
168 views

Execution Plans Query

I want to check the estimated number of rows of a query in MS SQL Server. I can right click on the query and select "display estimated execution plan". but I want to do the exact thing with a hard ...
4
votes
1answer
1k views

Primary Key Type's Effect on Performance in Oracle?

In MS SQL Server, it is well documented that the type of the primary key can have a dramatic effect on performance. Using narrower types and sequential values significantly improves insert performance ...
5
votes
3answers
277 views

How do I add a time dimension to this forecasting database without having to duplicate every data point @ each reforecast?

I have a database designed to facilitate revenue forecasting. Revenue forecasting consists of tracking Orders which are recognized into Revenue at multiple points in time (each, a revenueDate). There ...
6
votes
2answers
462 views

Using 100's of schemas in a database SQL2008R2?

We are in SSAS type of environment with 100's of clients. Currently each client gets a database and we have 200 per instance on SQL Server 2008R2. This presents limitations with snapmanager being ...
5
votes
2answers
1k views

Span single transaction over several sequential psql sessions

I am running PostgreSQL 8.4 database server and psql terminal front-end on Ubuntu 10.04 Lucid Lynx and would like to span a single transaction over several sequential psql sessions. When I connect to ...
18
votes
1answer
4k views

MySQL : Why are there “test” entries in mysql.db?

Recently, I posted an answer to a question about mysql.db. Then, I got to thinking I should ask everyone this question: I have noticed for years that upon installation of MySQL 5.0+, mysql.db is ...
4
votes
3answers
691 views

How do I model data from arbitrary CSV's in a database?

I am setting up a web interface for data management. Users upload CSV or similarly structured files, and I want to store these in the database so they can do manipulations on them -- filtering, ...
3
votes
2answers
930 views

Shrink Log File without breaking Log Chain

What is the best way to shrink a log file without breaking the log chain? I realize you can do something like: alter database yourDb set recovery simple go dbcc shrinkfile(LogFileName, 0) go alter ...
2
votes
2answers
1k views

Is to possible to forbid access to tables in own schema - Oracle?

Lets assume that we have the following situation: We have an Oracle schema/user: USER_TEST (with the "create session" privilege). SYS as SYSDBA creates couple Tables on schema USER_TEST. Is it ...
3
votes
1answer
285 views

Does MVC architecture design pattern effect MySQL database performance?

Our current site is entirely developed in the cakePHP framework with the MVC architecture. If we notice more than around 19-20 users viewing the site at once, it begins to crawl to a hault and begin ...
6
votes
3answers
9k views

Get Job id OR Job name from within executing job

I have a central DB that I write job outcomes on all my servers back to. I pass 3 parameters via powershell in a SQL job back to a sp on the central server that verifies the job should be running at ...
4
votes
3answers
5k views

What is the mysql.db table used for?

Related to my MySQL issue I have a user with USAGE grant in mysql.user, but in mysql.db this user has Select, Insert, Update, Delete. Thus the user can successfully query the database. I can't find ...
1
vote
1answer
213 views

Slony not replicating changes from a dump file

I’m working on a project where we are using pg_dump to get the data out of one database and then using psql to load it into another. The second database is the master db in a Slony replication ...
3
votes
3answers
1k views

Is it good idea to change Simple Recover Model into Bulk-Logged on ETL system?

We are having an ETL process which inserts lots of data into tables. This database is set to Simple Recovery Model and the transaction log is growing a lot. I was thinking that would it help to set ...
5
votes
2answers
18k views

Grant create permission on a specific schema in Oracle 11g

I have two users A and B. I want to grant B the permission to create, drop, etc. all tables in A's schema. As far as I can see, I can grant B full access to all schemas not a specific one. Is this ...
2
votes
1answer
759 views

Sql Server 2005 - sqlcmd with output to shell and file

I do some command line batch (.bat) with sqlcmd as this way: sqlcmd -i Scripts\STEP01.sql -o PROCESS.log -S MYSERVER -E -d MYDATABASE and i need an output file (it's works currently) and also the ...
0
votes
1answer
183 views

How to improve restoring the PostgreSQL database?

I'd like to restore the PostgreSQL database from a dump. The below command works fine for me: CALL "%PGBIN%\pg_restore" -c -d NetCatalog %DUMPFILE% How can I add a few lines to my .bat file to ...

15 30 50 per page