0
votes
0answers
4 views

Dynamic Table partitioning on a daily basis

I have a mssql database which contains two tables. Acks and Logs. These two tables are related in logic but not in a relational database way. Basically every message that comes in, gets saved in the ...
0
votes
1answer
6 views

Rank variable value in MySQL is always being set to null

In a sample procedure I am trying to find the rank the of the cities according to the number of offices. I have a Location Table and an Office Table and a location can have multiple offices ...
0
votes
1answer
8 views

Mongo import error: exception:read error, or input line too long (max length: 16777216)

I have a shareded collection which I'm trying to migrate from an existing production Cluster running v 2.4 to a new one running 2.6. As both clusters are shareded, I'm using mongoexport from the old ...
0
votes
1answer
8 views

How to sync on demand beetwenn two database in the same server mysql

I'll like to know if it's possible to have a systeme on synchronisation beetween two database in the same server. I have a production database in my server , i want a dev database (same database with ...
0
votes
0answers
10 views

Should I drop this column or is there a query that can achieve a results table without duplicate columns?

I use a column named active in several of my database tables to adjust whether a particular entry/row/user/etc should be included in future query result tables instead of deleting the information. ...
0
votes
0answers
5 views

long mysql insert and update script user variables appear to be lost while running script

I have a mysql database table called 'dash_something' dash_something ------------- date, DATE *this is the date of the summary type, CHAR(10) entity, CHAR(25) number_of_emails_1, INT ...
0
votes
1answer
12 views

In what way are Access tables linked with SQL server?

I have a mdb file with lots of OBDC linked tables that are linked to the tables in SQL server elsewhere. I can not see any information on how they are "linked". It is a little scary not knowing ...
0
votes
0answers
11 views

MySQL JDBC does not behaves as the MySQL Workbench

I'm running the following from the MySQL Workbench, and from my local tomcat using jdbc. START TRANSACTION; CREATE SCHEMA IF NOT EXISTS `ROOT`; CREATE TABLE IF NOT EXISTS `ROOT`.`all_tables` ( ...
1
vote
0answers
20 views

Many small queries or one single query

This is not exactly a question, more of a survey. Here at BlackBean we have a time series aggregation and analysis platform built on top of MySQL, where each client have your own database, and each ...
0
votes
1answer
10 views

Separation of users columns in another table

I've got a quite a lot of columns on the users table and I have been cleaning it up recently. Now since I'm searching over the users I figured it would improve performance if I separated verification ...
1
vote
1answer
14 views

Indexing the difference between two columns in MySQL

Is there a way to optimize/index a query that sorts the difference between two columns. I have a modest sized table of 5 million rows that I'm trying to do the following: SELECT pk_column, column_x, ...
1
vote
1answer
19 views

Can I use attribute name to identify XML element?

Rather than using the element index COLUMN[1]/@value below, is it possible to retrieve the COLUMN Value by specifying an attribute name such as: COLUMN[@name=”Prod_ID”]/@value? When I tried, it ...
1
vote
2answers
84 views

How to get Identity Column to jump ahead (by say 1000) on SQL Server 2012

I am using SQL Server 2012 and I would like to keep my pre-existing data but to cause the ID (identity) column to skip by 2000 rows. Why is this happening? I have a scenario where I may have ...
0
votes
2answers
21 views

Duplicate Statistics?

I have been looking at poorly performing stored procedure that performs well for larger customer databases. I believe the reason is that SQL Server has not had time to properly create good statistics ...
0
votes
3answers
21 views

PostgreSQL equivalent of MySQL query variables?

Hello Stack Overflow Exchange People Is there a straightforward way to adapt these types of mySQL queries to postgreSQL: setting variables in MySQL like set @aintconst = -333 set @arealconst = ...
0
votes
0answers
35 views

Memory Issue - SQL Server 2008r2

I am trying to troubleshoot a memory issue on a 2008r2 instance. Very high resource semaphore waits are present and a general slowdown of queries,backups,dbcc checks. Only one instance of SQL Server ...
0
votes
0answers
13 views

Allow filtering not working as expected

I'm having issues with getting ALLOW FILTERING to work. In our Cassandra 1.2 database, we have a table like this: CREATE TABLE some_table partition_key text, other_key text, non_key ...
0
votes
1answer
13 views

How To Merge Database Projects on Visual Studio 2013

Can I have multiple database projects to the same SQL Server database? Like, one main project referencing multiple subprojects. I have an application which multiple modules and each modules has it's ...
0
votes
1answer
18 views

queries for hierarchical data

This table is a questions and answers CMS and i want to know how data is fetched from these tables. +------+----------+-------+ | id | parentid | type | +------+----------+-------+ | 1 | 0 ...
1
vote
1answer
27 views

SQLDriverConnect fails when attempting to connect to Failover_Partner

SQLDriverConnect fails when attempting to connect to Failover_Partner. Connection string being used: Driver={SQL Native Client};Failover_Partner=tcp:dby;Server=tcp:dbx; ...
1
vote
1answer
15 views

No results from traceid from sys.fn_trace_getinfo(0);

SELECT DISTINCT(eventid) FROM sys.fn_trace_geteventinfo(#); The above command returns no results. There should be a bunch of trace event id being traced.
1
vote
1answer
21 views

PL/SQL operating system call

I'm trying to lauch a system call from Oracle Apex, directly or indirectly. It seems to only accept PL/SQL procedures, so I iterated towards this: begin :p3_request_id := sequence.nextval; ...
0
votes
1answer
7 views

Type of an id field that references another id field

I'm on postgresql. I have a table user (id serial not null) and another table client(id) i need to create a : foreign key client(id) references user(id). What the client(id) type should be? Int or ...
12
votes
0answers
23 views

How to calculate/store Top 10 in a tabular model?

We have recently created an SSAS tabular model so our users can access it via PowerView. We have a measure on one of our fact tables to get the TotalActiveItems using a formula: ...
4
votes
2answers
59 views

Avamar SQL Agent running against live SQL Server databases

We use a large company as our service provider. The tech people from that service company are pushing very hard to install something called the Avamar SQL Agent which purportedly will be used to ...
0
votes
0answers
28 views

SQL Server Data access does not connect unless we provide the port number

I have configured SQL Server 2008 R2 named instance on Windows Server 2008 R2 to listen to only one IP,1433. Some Office 2010 clients are trying to connect using the external data to SQL Server using ...
0
votes
1answer
38 views

deleting a table referenced by many foreign keys

I have a table that I want to drop and create again, because I want to add the IDENTITY property to a column, wich is not possible directly. The problem is that I can't drop it, because my column is ...
1
vote
1answer
20 views

Adding foreign keys constraint on databases used

We have a server with about 20 databases, all duplicates of the same original db, and we just noticed the original is missing all the foreign keys constraint for some unknown reason. So of course all ...
0
votes
0answers
27 views

sql query cant group this table's data according to first column

WITH t2 AS (SELECT Tarih , [0-20000] = COUNT(CASE WHEN Yük= 20000 and Yük= 21000 and Yük= 22000 and Yük= 23000 and Yük= 24000 and Yük= 25000 and Yük= 26000 and Yük= 27000 and Yük= 28000 and Yük= ...
0
votes
2answers
40 views

Check Constraint with Case Statement

I want to add a check constraint on a column if entered value for column is greater than 3 than it should be saved as 1 else entered value. For that scenario I am using below query but on insertion of ...
0
votes
0answers
23 views

Update existing (old) rows vs delete and insert when needed

I'm building a database system that needs to store login tokens for a system that validates if a users login token is valid or outdated. The table is pretty simple UserID int Primary Key LoginToken ...
2
votes
1answer
27 views

Multiple Table Pivot

I have a few tables that need to be converted into a single new table. I'm positive (un)pivot is the solution to the problem. However, I'm uncertain what the best way is to unpivot data from ...
5
votes
1answer
103 views

Why are simple SELECTs on InnoDB 100x slower than on MyISAM?

I have quite an annoying problem. I want to use INNODB as my main database engine and give up on MyISAM as I need the former for using galera-cluster for redundancy. I copied (description follows) ...
2
votes
1answer
97 views

How to find number of days since beginning of fiscal month?

This relates to my question How to find XXth day of previous month in SQL server? The fiscal month starts on 26th of each month. I need to find out from any date: The date of the start of the ...
0
votes
0answers
48 views

Technical documentation for Replication [on hold]

My boss wants me to write a technical paper on replication, I don't know where to start or what to write about. We held a discussion and he talked about: Managed Code (we use VB.NET) Triggers ...
0
votes
2answers
57 views

Speed up a MySQL BETWEEN query

SELECT dateToFind FROM table1 INNER JOIN table2 ON dateToFind BETWEEN dateFrom AND dateTo I need to improve the performance of this kind of query. I added BTREE indexes on dateToFind, dateFrom, ...
0
votes
2answers
31 views

MySQL Replication: Seconds Behind Master super high

I've set up a slave db server for my production database, but when I checked the show slave status, I noticed a super big number in seconds behind master. This is the output: ...
0
votes
2answers
13 views

postgresql cannot drop a table when autovacuum holds lock on it

Autovacuuming process holds RowExclusiveLock and ShareUpdateExclusiveLock on the table, which I want to drop. I read that autovacuum should be canceled automatically, when submitting DROP TABLE ...
0
votes
0answers
10 views

How to model mappings at various levels

I'm trying to design the database model for my application and I'm finding it difficult to design the mappings for user access to various entities stored in the database. If access was only ...
1
vote
1answer
18 views

InnoDB deadlock with INSERT .. SELECT

I am trying to understand why a deadlock occurs when two workers in parallel are running INSERT .. SELECT queries on a table which has both 1) auto incremented primary key, 2) a unique index on ...
0
votes
0answers
8 views

What Is dummy bind in mainframe?

I am new into a mainframe project.Here after compiling when a program gets return code as 004,they do a dummy bind and it runs fine.Can someone please tell me what dummy bind is all about?
0
votes
1answer
31 views

How do I maintain high INSERT-performance on PostgreSQL

I'm working on a project which is parsing data from measurement files into a Posgres 9.3.5 database. At the core is a table (partitioned by month) which contains a row for each measurement point: ...
2
votes
3answers
201 views

Using expressions in the SELECT list to thin down a CASE statement

I have a query I'm working through rewriting - it has a huge bunch of case statements in the select list that all basically look like this: select Column1 = case when (Something = 2) and ...
2
votes
1answer
65 views

Why does my query end up with two seeks instead of one and how do I fix that?

I have these two tables: CREATE TABLE [TaskItems] ( [ItemId] UNIQUEIDENTIFIER NOT NULL, [LastOperationTime] DATETIME NULL DEFAULT GETUTCDATE(), [OwnerId] ...
0
votes
0answers
24 views

Storing DB credentials in an application source code?

I am making an app which connects to a DB, and the app will have plenty different userslogins. Is it a good design choice to have a specific DB login/password for the application, using which the ...
0
votes
0answers
6 views

How to migrate a mysql server in production to Percona XtraDB Cluster

I need some help : I have a mysql server in production and i want to migrate all the database to an existing cluster (percona xtradb). For now , my idea is : 1) Lock all tables 2) do a dump per ...
0
votes
0answers
5 views

PostgreSQL: Which connections is blocking ALTER TABLE?

I would like to add some fields to a table in all testing and production DBs, all of which are stored in PostgreSQL 9.3 on Amazon RDS. ALTER TABLE users DROP COLUMN IF EXISTS device_language; ALTER ...
0
votes
0answers
20 views

SQL query to return columns per value in value range?

I have a table like this: Date Value1 Value2 2009-12-30 23334 93 2009-12-31 21989 97 2010-01-01 18638 62 2010-01-02 ...
0
votes
0answers
25 views

Speed up sorting in this query

I'm trying to optimize the following plan and noticed that PostgreSQL spends a lot of time (relatively speaking) on sorting before the merge joins. Is there a way (using indexes, cluster the table, ...
1
vote
0answers
52 views

Outer Apply vs Left Join Performance

I am Using SQL SERVER 2008 R2 I just came across APPLY in SQL and loved how it solves query problems for so many cases, Many of the tables I was using 2 left join to get the result, I was able to ...

15 30 50 per page