Most Popular

1500 questions
19
votes
4 answers

Set a column's default value to the concatenation of two other columns' values?

I have a Postgresql 8.1 database. In one table, there are three columns: first_name, last_name, display_name. Is it possible to set the default value of display_name to be first_name + " " + last_name?
MattSayar
  • 293
  • 1
  • 2
  • 6
19
votes
5 answers

How to manage millions of users?

I am about to launch something really big. I need to prepare my server and database. I would like to group each set of 100,000 users in separate user tables but I do not know how to associate one user trying to log in to the appropriate user…
Chris
19
votes
2 answers

Why does SELECT 1/2 return 0?

As the title says. I even tried SELECT CONVERT(NUMERIC, 1/2) which also returned 0. I am using SQL Server 2008.
Anonymous Maximus
  • 769
  • 2
  • 8
  • 15
19
votes
2 answers

How mongoDB projection affects performance?

From MongoDB documentation it is mentioned that: When you need only a subset of fields from documents, you can achieve better performance by returning only the fields you need How filtering fields affect performance? Is the performance related…
Alireza
  • 3,586
  • 10
  • 35
  • 43
19
votes
3 answers

How to use prepared statements within MySQL stored procedures?

I'm using mysql and I need to somehow use the column curid returned by the prepared statement in the later query. I use prepared statements because as I've read, it is the only way to pass a variable to the LIMIT clause. I have this stored procedure…
donk
  • 525
  • 2
  • 6
  • 13
19
votes
2 answers

MongoDB terminates when it runs out of memory

I have the following configuration: a host machine that runs three docker containers: MongoDB Redis A program using the previous two containers to store data Both Redis and MongoDB are used to store huge amounts of data. I know Redis needs to…
Simone Bronzini
  • 293
  • 1
  • 2
  • 6
19
votes
6 answers

mysql wont start after increasing innodb_buffer_pool_size and innodb_log_file_size

I am following this solution here https://stackoverflow.com/questions/3927690/howto-clean-a-mysql-innodb-storage-engine/4056261#comment14041132_4056261 and tried to increase my innodb_buffer_pool_size to 4G and later 1G (also 1024M) in addition to…
giorgio79
  • 1,387
  • 7
  • 18
  • 19
19
votes
2 answers

Make Postgres database temporarily read-only (for performing volume snapshots)

The PostgreSQL built-in backup mechanism isn't always very suitable. Sometimes, you want to put the application in a quiescent state, because it has external data with which you want to backup at the same time you back up the PG data. But the only…
Otheus
  • 554
  • 1
  • 3
  • 13
19
votes
5 answers

SQL Server Error 8632 due to over 100,000 entries in WHERE clause

My problem (or at least the error message) is very similar to query processor ran out of internal resources - extremely long sql query. My customer is working with an SQL select-query, containing a where-clause with exactly 100,000 entries. The…
Dominique
  • 497
  • 1
  • 3
  • 12
19
votes
3 answers

Forcing Flow Distinct

I have a table like this: CREATE TABLE Updates ( UpdateId INT NOT NULL IDENTITY(1,1) PRIMARY KEY, ObjectId INT NOT NULL ) Essentially tracking updates to objects with an increasing ID. The consumer of this table will select a chunk of 100…
19
votes
6 answers

Does ALTER INDEX ALL REBUILD use more transaction log space with simple recovery model than rebuilding each index individually?

An "ALTER INDEX ALL REBUILD" operation on SQL Server 2012 failed because the transaction log ran out of space. The indexes have never been reorganized or rebuilt, so fragmentation is over 80% on nearly all of them. The DB uses simple recovery model.…
Google Fail
  • 193
  • 1
  • 6
19
votes
2 answers

Difference between star schema and data cube?

I am involved in a new project, where I have to create data cube from the existing relational database system. I understood that, the existing system is not properly designed, I am not sure where to start. My question are: What is difference…
Rathish Kumar B
  • 2,134
  • 5
  • 20
  • 34
19
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
  • 868
  • 4
  • 9
  • 24
19
votes
3 answers

SQL Server cardinality hint

Is there a way how to 'inject' a cardinality estimation to a SQL Server optimizer (any version)? i.e. something similar to Oracle's cardinality hint. My motivation is driven by the article, How Good Are Query Optimizers, Really?[1], where they…
Radim Bača
  • 253
  • 2
  • 8
19
votes
1 answer

Querying non-ASCII rows from Postgres

Does [:ascii:] class work in Postgres at all? It is not listed in their help, however I see examples in the web which utilize it. I have a UTF-8 database, where collation and c_type are en_US.UTF-8, and Postgres version is 9.6.2. When I search for…
Suncatcher
  • 357
  • 2
  • 4
  • 12
1 2 3
99
100