0
votes
0answers
7 views

Can I estimate the row count of a large mysql table using the disk space?

Sysadmin here (not a developer by trade), so go easy please ;) I have a mysql table, on a linux server that uses innodb_file_per_table. When I try to do select count(foo) from table; It doesn't ...
0
votes
0answers
5 views

Create new item from others itens

I am developing a register of "items/products", there are situations that the items are merged into a new item. If I have the "Product A", "B product" and "product A + product B" When editing the ...
0
votes
0answers
6 views

Dynamically REVOKE CONNECT FROM guest in SQL Server 2005

I wrote this simplistic script (I'm not very familiar with TSQL and dynamic SQL) to revoke all connections from guest accounts: DECLARE @database_id int, @database_name nvarchar(100); DECLARE ...
0
votes
1answer
6 views

How to store temp tables in memory during table “optimize”?

When optimizing tables, SHOW PROCESSLIST lists it as "copying to tmp table". I'm trying to ensure the copy takes place in memory to speed up the process. I've tried adjusting the tmp_table_size to ...
0
votes
0answers
6 views

MongoDB on Raspberry Pi --dbpath not setting

I installed MongoDB using this tutorial. I have tried to set --dbpath in /etc/mongodb.conf like this: dbpath=/path/that/iwant #where to log logpath=/var/log/mongodb/mongodb.log logappend=true ...
0
votes
1answer
11 views

MySQL ran out of space, now won't start

So the partition MySQL was mounted on ran out of space. As a quick fix, I decided to move mysql's data directory to /home/minecraft/mysql/. I then changed the datadir in the config to the correcy ...
1
vote
0answers
15 views

Relational modeled design

The scenario (I believe this question has quite a limited scope and assume with complete normalization a "best" design can be concluded regardless of differing opinions) I have images in a database ...
0
votes
0answers
8 views

No privileges on the admin

I am using MySQL on AWS, and I came to horrific realization that privileges were flushed shut N across the board today. I was able to view this from an other user has very few privileges, but one of ...
0
votes
2answers
13 views

Returning empty string when string_agg has no records

I am trying to return a text field in a PostgreSQL query that is of the form 'stringOne' || string_agg(field, ',') || 'stringTwo' where for certain elements in the group clause, field is always ...
8
votes
3answers
64 views

In SQL Server, should I force a LOOP JOIN in the following case?

Typically, I recommend against using join hints for all the standard reasons. Recently, however, I have found a pattern where I almost always find a forced loop join to perform better. In fact, I am ...
2
votes
1answer
8 views

How to create function(table_name) that returns a set of the table

I have a set of tables that share the same fields (some timestamps and users names used for version control). I need to create a function with dynamic sql that uses a table_name and a timestamp as ...
1
vote
0answers
23 views

Phantom Transactions using Version Store in tempDB

We are seeing version store space increasing on one of our servers, and there are ~20 sessions that are showing as actively accessing version store rows for over 24 hours. The problem is, when I try ...
0
votes
0answers
33 views

OUTER APPLY vs LEFT JOIN

I'm working on the query bellow. Its structure is based on someone else's similar query... SELECT tptype.Code AS ThirdpartyTypeCode, ptf.Ticker AS TextId, finIn.InternalCode AS ...
0
votes
0answers
10 views

How to pass log file in pg_dump

I am using this command to export. export PGPASSWOD=${PASSWORD} pg_dump –i –b -o -host=${HOST} -port=5444 -username=${USERNAME} -format=c -schema=${SCHEMA} --file=${SCHEMA}_${DATE}.dmp ${HOST} ...
-1
votes
0answers
35 views

MS SQL Server Implement Limit Functionality

I am facing problem to implement the pagination on grid. Actually after applying all the filter we get 3000k records from database but if pull the 3000k data the query take time so I am showing only ...
0
votes
1answer
15 views

Merge left outer join column

I have a query that use left outer join. something like that : select issues.id, journal.notes from issues left outer join on (issues.id = journal.issue_id and journal.notes != '') So far it ...
1
vote
2answers
51 views

Will redirecting queries to dev/null warm up indexes?

I'm trying to warm up the buffer pool. Will running a query and re-directing the output to /dev/null suffice? e.g. mysql -u username -p -e "select id from tbl where 1=1" > /tmp/results.txt Thanks
0
votes
1answer
14 views

Installing scott schema for oracle 11g express

I want to install scott schema, a sample database in oracle. But in express edition, I can't find out it. Please help me install it on Oracle 11g express. I'm a newbie, pls help me
1
vote
1answer
30 views

Looking for ideas on maintaining data warehouse in close to real-time - ETL tools, etc

I have done a fair number of traditional data warehouse implementations where the loads were done in a batch-oriented manner, i.e. the data is refreshed nightly or, at most, every few hours. I now ...
0
votes
0answers
16 views

Is there a psql equivalent of bash's reverse-search-history?

I am very fond of bash's reverse-search-history (C-r) (command-line feature): Search backward starting at the current line and moving ‘up’ through the history as necessary. This is an incremental ...
0
votes
1answer
32 views

What data will be lost with DBCC CHECKDB (REPAIR_ALLOW_DATA_LOSS)?

I have a corrupt database. The last known good backup was over 2 weeks ago. I've run a CHECKDB and have the page numbers where SQL Server located the corruption. I've looked at the data on the ...
2
votes
2answers
165 views

DISTINCT not using an index

I have table (2139868 rows): COLUMN1 NUMBER(20,0) COLUMN2 XMLTYPE COLUMN3 XMLTYPE COLUMN4 VARCHAR2(50 BYTE) COLUMN5 VARCHAR2(50 BYTE) COLUMN6 VARCHAR2(50 BYTE) COLUMN7 VARCHAR2(50 BYTE) COLUMN8 ...
0
votes
0answers
5 views

Upgrade MongoDB meta-data after binary upgrade

I upgraded our MongoDB binaries from 2.2.5 to 2.4.9. I did not follow one of the considerations prior to upgrading: To upgrade to 2.4, sharded clusters must upgrade following the meta-data upgrade ...
0
votes
0answers
14 views

Issues with Inserting due to FK constraints

I have two tables: Employee, and Department. They are setup like so, : CREATE TABLE IF NOT EXISTS `mydb`.`Department` ( `Dname` VARCHAR(25) NULL, `Dno` INT NULL, `Total_sal` INT NULL, ...
1
vote
1answer
61 views

What is the best way to get all data for a date range, plus the last event just before the range?

For this question assume the following: There is a table of events [Event] There is a table of employees [Employee] There is a table that relates the two [EventEmployee] (EventID + EmployeeID) Each ...
1
vote
1answer
27 views

Avoiding entitized characters when using FOR XML PATH for string concatenation

I have this query: SELECT DISTINCT f1.CourseEventKey, STUFF ( ( SELECT '; ' + Title FROM ( SELECT DISTINCT ...
0
votes
1answer
11 views

Failover Mirror

My name is Jackson and I'm from Brazil, sorry about my English. My question is about the failover process in SQL Server Mirror. Question: If just the database, not a instance or a server, goes ...
0
votes
1answer
20 views

SQl comand works in Workbench but not from Java Program

I am working on a program that manages a database of client information. I am currently stuck on a problem where the SQL statement created by my java program but get the error SQLException: You ...
0
votes
0answers
8 views

“Display width out of range for column” error when importing mysql 5.1 dump into 5.5

I am migrating to a new server, and trying to move my database from a 5.1 to 5.5 server. I created a dump with mysqldump -u root -p --add-drop-database --triggers dbname > dbname.sql When I ...
1
vote
1answer
41 views

Error checking with sp_send_dbmail

This question is kind of multifaceted. First, what I'm trying to actually accomplish: I am in an environment where there is not really heavy data validation on inputs. So there is lots of opportunity ...
0
votes
1answer
20 views

DB2 removing white spaces in field values

In a table I have a column called column_xml defined as CLOB(1000000). The fields in the column contain XML formatted information. My problem is that there are lots of white spaces in these fields ...
1
vote
0answers
27 views

Profiling parameters

I was trying to fine the parameters of a query I suspect to be causing unnecessary logical read and eventually captured it in profiler, however parameters @p3 and @p4 are not listed. Is anyone able ...
0
votes
0answers
15 views

Many temporary tables created on disk since mysql 5.6 upgrade

I recently upgraded MySql (from 5.5 to 5.6) on a Debian Wheezy server. Drupal 7 and a PunBB board are installed on this server (Drupal 7 database size: 54 M / board database size < 800 M). These ...
1
vote
3answers
29 views

New SQL Server 2008 instance, load old instance DB's

BACK STORY: I'm a developer with a local instance of SQL Server 2008 on my workstation. I just recently upgraded my motherboard and found out (much to my dismay) the old motherboard's RAID drivers ...
0
votes
0answers
42 views

Avoid transaction rollback when Deadlock is encountered (mysql)

I'm currently trying to handle concurrent inserts correctly using MySQL, I'm basically doing the following: CREATE TABLE foo (id INT NOT NULL PRIMARY KEY) ENGINE=INNODB; CREATE TABLE bar (id INT NOT ...
0
votes
1answer
28 views

How to decide whether to enable MySQL query cache using InnoDB

How should the decision to enable / disable the MySQL query cache be made, on a server that uses just InnoDB tables. Say for example, if the cache is enabled, then how should the output of: SHOW ...
0
votes
0answers
16 views

MySQL CPU high usage

My MySQL service started to using a lot of CPU recently. Few second after restart it takes 100% CPU's. I tried already changing my.cnf file to optimize cache/buffers. I have no idea what causing that ...
3
votes
1answer
47 views

sql indexing and performance

I am using mysql5.1, i have table which has about 15 lakh (1.5 million) records.This table has records for different entities i.e child records for all master entities. There are 8 columns in this ...
-3
votes
0answers
32 views

Is it possible to get the queries executed in the past? [on hold]

Is it possible to get the queries executed in the past? the server is restarted.
0
votes
2answers
25 views

MYSQL: Join with many to many

I'm trying to create a view and trying to see what can be done, I have a main table a table I wanna join to and also a junction table. Event table (it's very big so it's just dummy data): ...
2
votes
4answers
65 views

Advanced design question related to compound primary keys

As a database design expert, I had a discussion with an academic person about database design and I need some arguments on why some design is bad or not normalized or bad practice. As we cannot ...
0
votes
0answers
11 views

Are mongodb bulk inserts really increase server perfomance (and faster)?

Bulk inserts always are faster in client side because of saving round-trips, but at the server-side is there any sensible performance improve? It seems the code for bulk inserts, just loops over ...
0
votes
1answer
19 views

How to grant super privilege to the user?

I have created a user and given privileges to the user1. `grant all privileges on db1.* to user1@'%' with grant option; Am using mysql workbench to import dumps to my database. While importing ...
0
votes
0answers
5 views

Best design of mongo replica set for DB read/write speed

I'm building a Node app that uses MongoDB. Whilst it would probably be fine to have node and mongo sitting on the same VPS, I want to ensure that the MongoDB is backed up and maintain high ...
0
votes
0answers
49 views

A rollback on a production server that's been running too long

I have a problem with a production server that is causing considerable locking and performance degradation. It all started the night of Tuesday into Wednesday with a procedure that inserts data into ...
0
votes
0answers
25 views

what values to set for the folowing PostgreSQL Variable [on hold]

I need to optimize my DB, in order to fine tune, what values to provide for the following variables, please advise, thanks. PgSQLIdleQuery PgSQLXclLock PgSQLConnections PgSQLMaxTTime PgSQLMaxQTime ...
-1
votes
0answers
28 views

the environment variables configuration for ORACLE EXPRESS 11g / windows7 32Bit

I can't connect in Oracle Express 11g (windows7 32-bit) and I think the problem comes from the environment variable ORACLE_SID & ORACLE_HOME , how can I get the database instance to do the right ...
1
vote
0answers
29 views

Using #temp to work around Reporting Services blocking issue

Having utterly failed to resolve why a perfectly acceptable but admitidly large stored procedure was suffering the blocking process lck_m_s when called via a report in SQL Reporting Services I have ...
1
vote
0answers
16 views

MySQL database stops working after log enabled

I have this strange issue. I have MySql workbench, which I use to make querries to mysql database (xampp 3.2.1). Everything works fine, but recently I found myself having to profile the querries my ...
1
vote
0answers
27 views

How to design a database structure for different groups of contacts?

I've been looking around for a while how systems manage their contacts. Most I encounter is creating a people or party table including a type to define the type of people/party. These types are either ...

15 30 50 per page