I've been trying to optimize the sort in the following query. I ran EXPLAIN ANALYZE and the majority of the time is during the sort when it arranges the output by distance.
I've tried converting the ...

I am new to an environment. The Databases are virtually untouched by a seasoned DBA. I am looking for ways to reduce DB size and possibly improve performance. Unfortunately, I only have WEb edition ...

How to get the row with the latest value in a TIMESTAMPZ column? Is an index needed? Does an index change the strategy? Would behavior vary by database (I'm using Postgres 9.4)?
My app records data ...

I came across the term Transaction Path Analysis which I am not familiar with. A Google search resulted in only a few results, most of which seem to assume everyone knows what it means. From these my ...

I have a table with a lot of columns. Two lookup functions are performed: 1) lookup by using column name (this happens rarely, maybe twice a season), and 2) lookup by column date. The column name has ...

Assume a mysql table with columns A, B, C, ... .
There are one composite index based on columns A+B+C. Combination of values A, B and C is unique, so this index forms the primary key.
Now, a second ...

This answer motivated think again my following tables but I am still uncertain how to store statistic data for quick selection.
I think it is well done with partial indexes because only a subset of ...

I have a general question about advanced issues regarding index behaviour.
In short, roughly one year ago, we dynamically dropped and recreated a number of indexes with different filters, but using ...

I'm attempting to use JSONB with JDBC, which means that I have to avoid any of the operators which use the '?' character (as the PostgreSQL JDBC driver has no escaping for this character). Taking a ...

Say we have a table against which a number of different queries can be executed and each query has its own combination of predicates.
So, for example, if we have a table with columns A, B, C, etc we ...

We have a huge query on an Informix database that is not performing well. The query is doing a join of 9 different tables. Maximum row count is just 40,000 rows. The query also has 9 sub-queries, and ...

What is the risk of doing a rebuild to my indexes in SQL Server 2012?
I have to do a REBUILD, but I don't know what are the risks .
The server is running and a lot of information is going in and out.
...

I want to check if our code does use only indexed columns.
I think it does, but I want to be sure.
How can I configure/modify PostgreSQL to raise an exception if it needs to do an sequence scan?
It ...

We have a table with about 20 columns in a Postgres 9.2.10 DB. For better performance on some SELECT queries, we plan to add an index on one column with data type timestamp. As the index also can slow ...

MySQL Server database is installed on RHEL5.5 and db version is 5.6.20 Community Server.
In MySQL database we have a table and it has 11,144 records. I am altering the table and adding index to it. ...