A database structure that can improve the speed of queries at the cost of disk space and slower inserts/updates. It stores a copy of one or more columns but structures the data differently to allow for faster access.

learn more… | top users | synonyms (2)

-1
votes
2answers
65 views

When there is a composite index and those columns are in query, does it use index seek? [on hold]

I have a table staff having columns, name, year,month and date. I have a composite index on year,month and date. If I have a query like below, will it use index seek scan? select * from staff where ...
2
votes
0answers
61 views

Why is this MySQL query “using where” instead of “using index”?

Could you help me with this query, please? SELECT p.patid, MAX(c1.eventdate) as eventdate from patient as p left join op_adv_effects._clinical as c1 on p.patid = c1.patid left join ...
0
votes
1answer
30 views

What is the risk of doing a rebuild to my indexes in sql server 2012?

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. ...
2
votes
0answers
38 views

SQL Server 2005 Datawarehouse DB - Integrity failure caused by NonClustered indexes

Last year I've been working with a data warehouse database (SQL Server 2005) loaded on a daily basis during the nights. Overall database performance is acceptable. However, there is a "known error" ...
0
votes
0answers
17 views

Composite primary key in Multi-tenant sql server database

I'm building a multi-tenant app (Single database, single schema) using Asp Web Api, Entity Framework and Sql Server/Azure database. This app will be used by 1000-5000 customers. All the table will ...
0
votes
0answers
6 views

Need a persistent, glorified array / bucket storage solution

I'm looking to create a system that logs information ( think, lots of writes, and a few reads ) in order of entry within a key/value datastore. The order precision is absolutely necessary above ...
0
votes
1answer
32 views

SQL Server : how can I measure database performance increase after index maintenance?

We are using a SQL Server 2005 database. We currently have no maintenance on our databases indexes. Some of our indexes are showing over 85% fragmentation when looking at the table ...
0
votes
0answers
28 views

PostgreSQL: raise error if planner needs to do an sequence scan

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 ...
0
votes
0answers
27 views

Optimal index wasn't being used until rebuilt

SELECT COUNT(T1.RECID) FROM LEDGERJOURNALTRANS T1 WHERE PARTITION=5637144576 AND DATAAREAID='abcd' AND JOURNALNUM='abcd-00018' This query gets run numerous times when users view a ...
0
votes
0answers
35 views

Indexing on cached data from related table using triggers — Is there a better way?

Edit: Schema details per request from Aaron Betrand -- I'll break the schema down to the relevant fields of the two tables. Orders (ID int IDENTITY, Status char(1)) Services(OrderID FOREIGN KEY ...
0
votes
0answers
52 views

Query Performance - Why is a query slower when there are two criteria on the same column?

I have these two queries against a view, where I've added WHERE clauses against a date column (Indexed, Unique, Non-Clustered, Ascending): SELECT ColA FROM MyView a WHERE a.[Date] >= ...
2
votes
1answer
59 views

Counting per status group makes query very slow

I have an Intranet system developed that takes in orders and every order item has their own status, i.e. "Printed", "Labelled", "Filed", etc. This query will need to count how many items there are in ...
0
votes
0answers
16 views

How can I use PostgreSQL's partial sum tree index (if it even exists)? Do any databases allow for use of such an index?

GiST (Generalized Search Tree) indexing is an advanced system which brings together a wide array of different sorting and searching algorithms including B-tree, B+-tree, R-tree, partial sum trees, ...
0
votes
0answers
5 views

Firebird Index Creation Fails

Im creating an index in a table with the following command: CREATE INDEX IDX_CVE_OBS ON FACTF01 (CVE_OBS); But it returns me the following error: this operation is not defined for system tables. ...
0
votes
1answer
18 views

MySQL 2 Million Rows, longtext and varchar indexes

I'm trying to find a solution for this, with no success. I have a table with ~2M rows, and I need to do a WHERE with 3 expressions using OR. name LIKE '%PARAM%' OR text1 LIKE '%PARAM%' OR text2 LIKE ...
0
votes
1answer
24 views

InnoDB index concurrent inserts

I have an InnoDB table with an index on it. I have a few million rows to insert, so I thought I might take advantage of the row-level locking and do it in parallel. I'm inserting in batches of 10000, ...
3
votes
1answer
52 views

'ERROR: text search dictionary “unaccent” does not exist' during CREATE INDEX?

I'm running PostgreSQL 9.3 on Mac OS X Yosemite. I try to create an unaccent lowercase trigram index. To achieve it I did this: mydb=# CREATE EXTENSION pg_trgm SCHEMA public VERSION "1.1"; ...
1
vote
0answers
59 views

Multiple SQL Server Indexes, which ones to keep?

I am looking at my database that several people have worked on. A particular table is responding slowly when queried on a certain join. I notice some of the parameters of the join are not indexed. ...
3
votes
1answer
69 views

SQL Server index causing incorrect behavior on cursors

I have a SQL Cursor that's behaving incorrectly as soon as we added an index to a table. Here's a trimmed-down example of the query causing issue: DECLARE @CUR_CRDATE NVARCHAR(8) DECLARE ...
1
vote
1answer
25 views

How can I create a database where entries are compressed files searchable by index? [closed]

I am trying to design a database solution for logging where the search indices are dates (days), and the values are zipped files. I am doing this because the sheer number of logs I am processing is ...
3
votes
1answer
126 views

Over 99 million records with geography column & spatial index - VERY VERY VERY slow queries!

I’ve been working with SQL Server for a long time but have only recently encountered the need to work with spatial data. I have come into an environment that uses it pretty heavily and my first real ...
0
votes
0answers
56 views

Slow query over 10mil rows with group by on indexed column

I've got a slow query which I want to optimize. SELECT pand.bouwjaar AS construction_date, count(*) FROM pand AS pand WHERE pand.begindatumtijdvakgeldigheid <= 'now'::text::timestamp ...
0
votes
0answers
7 views

indexing table column on the go of mysql query commit

It is said that to optimize the query cost of execution, then it would be by indexing the field of tables in database. Since I don't have a permission to enter the phpmyadmin in my web server as I am ...
0
votes
1answer
30 views

SQL Server collecting SQL statements using particular index

I'd like to capture SQL statements that uses a particular index. Is there a way I can utilize SQL Profiler or extended events to do so? I know I can view the plan cache to get a gist of the queries, ...
3
votes
0answers
59 views

Is it possible to get seek based parallel plan for distinct/group by?

An example from this question shows that SQL Server will choose a full index scan to solve a query like this: select distinct [typeName] from [types] Where [typeName] has a non-clustered, ...
2
votes
0answers
56 views

Unique Index much bigger than the table itself

Pg 9.3 on debian 7. I have a very huge table in rows, about 178 million (will turn 250 million in a week and then grow 500 thousand a day), but not that huge in size, wich is 20GB, it's a small ...
1
vote
2answers
56 views

Compressing partition - what about index?

To save space on disk I want to compress some partitions of my tables: alter table TEST_TAB move partition TEST_TAB_2014 compress for all operations; I have also indexes on this partition. Should I ...
0
votes
2answers
41 views

How can I decide Rebuilding Index with DETAILED or SAMPLED on SQL Server

I want to rebuild my indexes and statistics on DB. How can I select this option on production maintenance. SQL Server Version : Microsoft SQL Server 2012 - 11.0.2100.60 (X64) (Build 7601: Service ...
1
vote
1answer
27 views

Postgres - Insert performance with indexes

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 ...
0
votes
1answer
15 views

What can cause an Index “total writer” to be the same in every index?

I have a table, with some Indexes ( created by me, others by SQL Server Profiler (SqlServer 2008)). I use this query to analyze unused Indexes: --Possible bad Indexes (writes > reads) SELECT ...
0
votes
1answer
61 views

Recommended number of index for a table

I've a table with many columns (~70) which contains computer's configuration. It contains approximately 50 000 rows. This table is very requested and all these column too. I use to run the following ...
0
votes
0answers
27 views

When I can DROP an index safely? [duplicate]

I would like to get rid of unused indexes in my database. I have identified many indexes that are never used (seeks, scans and lookups are 0), and are being updated during DML operations. I used ...
0
votes
1answer
38 views

One Non-Clustered Index that covers every possible combination of predicates?

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 ...
1
vote
2answers
184 views

Is it a good idea to include a value column (e.g. from measurements) in an index?

Is it a good idea to include a value column into an index for a table which has many million rows? For example a measurement table which looks kind of like this: CREATE TABLE measurements ( id ...
0
votes
1answer
33 views

Oracle can't drop index with . in name?

I am trying to drop an index that has a dot(.) in its name and can't seem to do it (I'm logged in as the SYSTEM user, which owns the index). Any ideas? SQL> select index_name,owner,status from ...
1
vote
0answers
20 views

Finding missing_index_details in MySQL

MS SQL Server apparently can tell you what indexes would be useful for your query. Is there anything similar in MySQL? This article (scroll to "Find missing indexes") says that in Microsoft SQL ...
1
vote
1answer
35 views

Automatic deduplication (normalization) of strings in MySQL

The question is whether MySQL can use separate physical storage for strings transparently, but with the same operations that are applicable to varchar, including %. I have a large number of ...
4
votes
1answer
60 views

Does MySQL exectution plan depend on available indexes?

Does MySQL choose an execution plan for a given query taking into account what indexes are available, or does it first choose an execution plan and then uses indexes if they are available? ...
0
votes
2answers
25 views

How to tell MySQL to ignore all indexes for a given query?

I've been benchmarking several queries and learning about indexes by using the explain function, profiling and the SQL_NO_CACHE option. My usual benchmarking session goes something like this: SET ...
3
votes
3answers
61 views

How does like query work with indexed table

I am working in Spring-java and mysql. I have to query the table of size 100k records. Table has say 10 columns. And In my sql select query I have to make like queries with %text% search on say 4 ...
0
votes
0answers
43 views

Eager Spool 100%

I have a query like below, when I execute it, the parallel query always takes very long time to finish, I found there is index spool(Eager Spool) which costs 100% in execution plan... How can I ...
1
vote
1answer
59 views

Poor query performance due to recheck condition on index scan

We are testing the performance of metadata when stored in JSONB compared to a traditional EAV catalogue (commonly used in biomedical scenarios), using a PostgreSQL 9.4 server. I get a problem when ...
1
vote
1answer
66 views

Recommended Postgres settings to speed up indexing on a 100GB database?

I have just installed Postgres 9.1 on a server with 32GB of RAM and 320GB solid-state disk. I will be using this server to serve both my site and my database (i.e. it's not just a database server). ...
0
votes
1answer
31 views

How to access the text definition of sql indexes

I am able to access the text definition of stored procedures, views, triggers and functions from sys.sql_modules. I want to get the text definition of indexes. How can I get the text definition of ...
0
votes
1answer
28 views

What does a CONSTRAINT have to do with my unique index?

I have to indexes on my table. The first was created by Django and the second by me. I'm not completely certain what the extra CONSTRAINT means in the first index and am wondering how I would change ...
2
votes
2answers
79 views

Is it a good idea to create an index for each column in a new table? [closed]

I will short my question. (SQL-Server 2008) Is it a good idea , when crating a new table, to create an index for each column? Why i'm saying this? Today I was creating a database, and my boss was ...
1
vote
1answer
94 views

What is an index KEY - emphasis on KEY?

In SQL Server, What does the 'key' part of the phrase 'index key' mean? Is the key a number? what is it? If I have the table of data containing a column called LastNames, and I have, say, a clustered ...
0
votes
0answers
84 views

Mongo range query became extremely slow on large collection

I have a collection which has 50 million records in it. After using wired Tiger its size became only 3 GB (2 GB data 700 MB index). I have created index on this collection. But when i do a range query ...
2
votes
1answer
37 views

How should a numeric value that is an external key be stored?

This is something I was pondering recently. trying to determine how to store certain values. The best wide spread example I can think of is Federal Employee Identification Number - more commonly knows ...
1
vote
1answer
39 views

Performance of Combination lookup

I've been looking into this most of the day and I'm still not getting far so I thought I'd ask on here. Basically its a lottery system and what I need to do is check whether 4 of the 6 balls I have ...