3
votes
0answers
43 views

A costly approach to filtering on a calculated date

This builds off my previously wonderfully answered question Running a complex query for every date in a range I've got an expanded problem and I'm certainly not solving it in a performant way. The ...
0
votes
2answers
2k views

mySQL Optimization Suggestions

I'm trying to optimize our mySQL configuration for our large Magento website. The reason I believe that mySQL needs to be configured further is because New Relic has shown that our SELECT queries are ...
2
votes
1answer
103 views

Updating large table worked before, now taking hours

BACKGROUND: I am using a non-production SQL Server to manipulate a large data set and run a few basic calculations. The original data file I have, which is about 30M rows, is missing records (not ...
0
votes
0answers
11 views

Caching impression counts to avoid mysql inserts

We currently get a LOT of mySQL inserts/updates on duplicate daily (millions) and we're looking at speeding up the application by using some form of counter with memcached and then clearing it on ...
-1
votes
0answers
20 views

HAVING Clause syntax question

Can a sum be computed using a case statement inside the HAVING clause of a query? something similar to this: GROUP BY id HAVING SUM(CASE WHEN date1 BETWEEN DATE_SUB(date2, INTERVAL 30 DAY) AND ...
0
votes
1answer
176 views

Array column vs another table when the relationship is quite small

The Data I am creating a table of cities and their zip codes for the United States. Some zip codes have a list of acceptable cities, as designated by the USPS. For example, the zip code 36613 is ...
0
votes
0answers
20 views

Denormalization vs Cached Data

I'm in a dilemma about denormalization of the database vs. caching the joint query results of the database. We have 2 tables. Let's say A and B. A may have many of Bs but B can be belong to only one ...
0
votes
0answers
15 views

How to store data of the subcategories table with different coloumns for each subcategory table for Products?

I'm new to database designing. I'll use MySQL and PHP. I'm designing a database in which I have a lot of category and subcategory like given below: Product Table p_id p_title category_id F ...
-1
votes
1answer
14 views

Mysql: How does a rollback operation be performed inside InnoDB

I would like to hear in simple words Please answer me in simple words to the question on the below scenario. ============== Engine: Innodb Trx1 : started and a DML is executed at 10:00 AM and rolled ...
2
votes
0answers
11 views

Complete deadlock on PostgreSQL 9.3 after removing a numeric id

The problem - complete DB lock after a schema change Architecture I use a PostgreSQL 9.3 with PostGIS to store location updates. The updates are written to two tables - location_updates and ...
-2
votes
0answers
8 views

Does CHECKDB require database to be locked for data Entry in SQL Server 2000?

As I see it, the DBCC CHECKDB('DBName', REPAIR_ALLOW_DATA_LOSS) TSQL command requires changing the DB to single-user mode with this command: alter database set single_user lock the database Then ...
0
votes
2answers
346 views

How to implement a dynamic string into a (prepared) sql statement?

I have some spatial datasets which are available in a open source metadata catalog software GeoNetwork and in a PostGIS database. The problem is that the student who created the database used ...
0
votes
0answers
15 views

Tables not updating and deleting the entries

I am facing the below problem on updating the tables ROW OPERATIONS -------------- 0 queries inside InnoDB, 0 queries in queue 3 read views open inside InnoDB Main thread process no. 2376, id ...
0
votes
2answers
4k views

How to solve “Can't connect to local MySQL server through socket” error?

I kept getting this following error every time I tried to restart MySql. It was working fine before I changed the default data directory. ERROR 2002 (HY000): Can't connect to local MySQL server ...
0
votes
2answers
217 views

Postgresql 9.4.1 stuck all queries when making multi updates

Before i used 9.3.5 and servers with ubuntu 12 with 32GB memory. After upgrade to 9.4.1, with more power server 60GB memory on each in wall replication and ubuntu 14, started get db stucks when run ...
1
vote
1answer
143 views

DB2 critical alert “database partition availability”

I have a existing DB2 database that I'm just getting started with and I have connected IBM Data Studio (web) to it and it says that it has the alert "Database Partition Availability" but it doesn't ...
0
votes
0answers
13 views

Performance Issue on Centos Server (Mysql)

I have performance issue on my centos server (vps). I asked about it in serverfault and I was said there is a problem with mysql and ask here. Here is serverfault topic, you can find details. ...
2
votes
1answer
42 views

Database Backup - In Process - Power Outage

I am using SQL Server 2008 R2. What happens if a database backup (Full/Differential/Transaction Log) is in process and there is a sudden power outage or the system crashes? Does that corrupt the ...
0
votes
0answers
5 views

Access 2007 reforming field formation

In student database I have a form which has drop down option for defining the class or level of a student. this field was set as options: Grade 1, Grade 2, Grade 3 and so on. Many students entries ...
2
votes
1answer
25k views

SQL Server is configured to allow remote connections

I use SQL Server 2012 and SSAS Tabular Mode (My Instance Name Is MSSQLSERVER2012T) Then I download AdventureWorks Tabular Model SQL Server 2012 From This link I open it with Visual Studio 2010 and ...
2
votes
1answer
99 views

Password generator function

What's the best way of creating a password generator user defined function function in SQL Server if it is not possible to use non deterministic funtions within functions? I would like to create a ...
7
votes
5answers
8k views

How do you find SQL Server version/edition without SSMS installed?

How do find out which edition is installed without having the management studio installed? I have a server that functions as a license manager for another software. Upon investigation of a high RAM ...
1
vote
0answers
38 views

Update Table Query: Automatically handle “Enter Parameter Value” prompts?

EDIT: Here are two database Files that demonstrate an applied example of the problem: Example_DBs.zip (Zipped due to 2 link limitation.) Note: The missing Field in "Not Working.mdb" is ...
2
votes
1answer
1k views

Connection to local SQL Server 2012 can be established from SSMS 2008 but not from SSMS 2012

I have two local SQL Server instances running on my local machine. The first is SQL Server 2008 R2 Enterprise Edition (named MSSQLSERVER) and the 2nd is SQL Server 2012 Business Intelligence Edition. ...
0
votes
0answers
17 views

Query Designer - Cannot connect to Server

I am following a tutorial to be able to use SQL Server Data Tools (SSDT) for reporting. However, I am having issues connecting to a particular database when I try to add a new DataSet and try to ...
3
votes
4answers
3k views

How to make SSMS upper case keywords

I recently started using Management Studio 2012. When using MySQL Workbench, a handy feature was that I could stay all in lower case and any reserved word (like SELECT, INSERT) would convert to upper ...
2
votes
1answer
58 views

select n values per group

Lets say I have the following table ----------------------------- | user_id | comment | ----------------------------- | 2 | thats cool | | 2 | awesome | | 3 ...
0
votes
1answer
180 views

Need Advice on Normalizing Database

I have a group of database tables that lack normalization. They all have a similar primary key called 'doc_index', which is either a PK by itself or part a composite PK. As you can see below, there ...
1
vote
1answer
15 views

Pausing the import of an SQL file in Postgresql?

I am currently importing a large database (6 - 7 GB's) into my postgresql on Ubuntu. It's taking sometime to do. A problem has come up where I need to physically relocate the laptop the postgresql is ...
1
vote
1answer
7 views

Postgres streaming replication between hosts with different timezone

I am running Postgres 9.1 on Windows 2012 servers. I am using postgres's streaming replication to replicate data between 2 servers. It has so happened that the time zone of the slave has not been set ...
-1
votes
1answer
2k views

SSIS package starts and stops immediately with a DTS_W_MAXIMUMERRORCOUNTREACHED, but there's no error to read

I have a package that, when I run it in Development mode, it outputs the following into "Execution Results": Import Validation has started Validation has ended Start, 10:36:27 PM ...
8
votes
4answers
729 views

Good, Bad or Indifferent: WHERE 1=1

Given this question on reddit, I cleaned up the query to point out where the issue was in the query. I use comma first and WHERE 1=1 to make modifying queries easier, so my queries generally end up ...
1
vote
3answers
101 views

Snapshot replication - How to detect when a snapshot has arrived on the Subscriber from the Subscriber DB

I have snapshot replication set up to on a server which publishes to a second server as part of a scheduled SQL Server Agent job. When the snapshot finishes, I would like to detect when each table has ...
5
votes
1answer
7k views

SELECT LIMIT 1 per column value?

Lets say I have the following table ----------------------------- | user_id | comment | ----------------------------- | 2 | thats cool | | 2 | awesome | | 3 | ...
1
vote
1answer
151 views

mysql autoincrement counter

I need a way to keep auto-increment counter between mysql service restart. As docs states by default after restart mysql autoincrement counter start from max(id)+1. How can I keep the last ...
2
votes
1answer
4k views

MongoVUE connect to mongodb with authencation failed!

I had a mongodb, and a database named genbank. Genbank has a user whose role is "read" and "readAnyDatabase". It is very strange that I cannot connect to genbank through this role by MongoVUE, but I ...
-1
votes
0answers
9 views

Error encountered during replication [on hold]

During replication i deleted the physical files of database which was in recovery state now it is in recoverypending state so how i can delete it
0
votes
1answer
1k views

SQL Server to MySQL sync, using Workbench, FreeTDS, and iODBC on 10.9

I've been struggling to get the MySQL Workbench to behave properly to complete the following: With Mavericks (OS X 10.9), connect to a SQL Server and create a migration job to a MySQL server. The ...
0
votes
0answers
20 views

Need to make sure database is fully normalised and all is accessible using MySQL and Java EE

So as per the picture: I need to create the roster table with all the data from the connecting ones - Each Roster entry will have the country,state and city, tech and subtech and client. Then ...
0
votes
0answers
15 views

SQL Server can not save Autogrowth changes

When I have change Enable Autogrowth checkbox (set to true) and save it (Ok) And when I go back to the Change Autogrowth for ..... I see that the changes have not been saved. SQL Server 2008R2 (I go ...
1
vote
1answer
935 views

h2 Java server synchronization and caching

I'm happily coding a client-server application in Java using H2 as database. The server runs the database as an embedded local database while clients connect to it via TCP. Now more and more I see ...
3
votes
2answers
4k views

Query: All employee with sum of salary > 500

In my MYSQL Database COMPANY, I have a Table: Worker : mysql> DESC `Worker`; +--------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | ...
1
vote
1answer
113 views

ON DELETE CASCADE not working

Trying to implement a simple user follower system in MySQL, using a junction table: CREATE TABLE users ( id int NOT NULL AUTO_INCREMENT, email varchar(255) NOT NULL, username varchar(25) ...
-1
votes
3answers
218 views

Upgrading Oracle from 11.1.0.6 to 11.2.0.2 on Linux Red Hat

I am trying to upgrade the Oracle db from 11.1.0.6 to 11.2.0.4 in Red Hat Linux 5.3. The current database is installed on location. I checked the path using command cat /etc/oratab ...
1
vote
1answer
194 views

Postgres automatic failover, multiple clients to multiple masters

I'm looking into providing a method of having multiple hot spare PostgreSQL instances to our website. The majority of implementations that I have found require a single point of failure with PgPool ...
0
votes
1answer
220 views

Delete files from disk, with a job, respecting some rules ( SQL Server 2008 )

We have An application that our customers use to download and upload files. I need to delete these files from disk after 30 days, of if it was downloded, in 7 days. How can i Use the script below, ...
0
votes
2answers
16k views

How to move csv file into oracle database using sql developer?

How to move csv file into oracle database without creating table firstly using sql developer rather than sql loader?
1
vote
2answers
43 views

Delete rows where matched value is twice as much

I'm trying to match two tables with two columns, table1 and table2. Each has id and price columns. I want the query to match each id and compare the price, then delete the row if the price in the ...
1
vote
0answers
31 views

Get average of multiple rows with criteria and return those rows

I'm attempting to get any items that are the same type, but are ranked one higher that have an average equal or greater than the item ranked below. I have a table and query like ...
2
votes
2answers
1k views

Why would increase in innodb_buffer_pool_size slow down MySQL?

5.1.68-cll - MySQL Community Server on CentOS The system has 32GB of RAM. I increased innodb_buffer_pool_size from 10240M to 15360M (10GB -> 15GB). Time taken for a series of identical operations ...

15 30 50 per page