Indexing databases
if we make an index on the primary key of a table how would it increase performance ,,,,as if the desired record afer creating the index might turn up in the end of the index list!! ...
if we make an index on the primary key of a table how would it increase performance ,,,,as if the desired record afer creating the index might turn up in the end of the index list!! ...
Hello, i'm using SQL Server 2008 and, in one of my tables, i implemented a (clustered) primary key on its identifier. Here's the table description: Identifier: - IdentifierId int NOT NULL PK - Alias nvarchar(200) - DataType int NOT NULL I made two indexes: one for Alias and another one for DataType. However, I just noticed somethin...
Hi, I've recently setup PHP 5.2.9-2 on IIS 7 on Windows Server 2008 SP2. Most everything seems to be working fine -- PHP is running great, just about all PHP code runs perfectly... EXCEPT for default pages. Any default document (index.php) is not interpreted by PHP and the page merely displays the underlying PHP code in the browser. Be...
Trying to create an index (and run some long queries) on DB2 v9.1 and failing with the following error message: SQL30081N (A communication error has been detected. Communication protocol being used: "TCP/IP". Communication API being used: "SOCKETS". Location where the error was detected: "". Communication function detecting the e...
We're having a problem where indexes on our tables are being ignored and SQL Server 2000 is performing table scans instead. We can force the use of indexes by using the WITH (INDEX=<index_name>) clause but would prefer not to have to do this. As a developer I'm very familiar with SQL Server when writing T-SQL, but profiling and perform...
Is there a quick and easy way to list when every index in the database last had their statistics updated? The preferred answer would be a query. Also, is it possible to determine the "quality" of the statistics: FULLSCAN, SAMPLE n, etc. EDIT this worked for what I needed, a slight mod to @OrbMan great answer... SELECT STATS_DATE(...
Hi, I am using a Mysql table products which has a foreign key category_id on the categories table the foreign key constraint is defined (Innodb engine). I noticed that when I run EXPLAIN SELECT * from products where category_id=1; it uses the foreign key, so I see type=Range and Key: my_foreign_key But when I run EXPLAIN SELECT * f...
I have a table which stores comma separated values in an NVARCHAR(MAX). I have created a view, which uses string manipulation to convert these comma separated values into an xml list. I can then use this Xml column access each item. The queries on this column will benefit greatly if I could index it. However, on trying to create a Prim...
I have a Postgres table with about 5 million records and I want to find the closest match to an input key. I tried using trigrams with the pg_trgm module, but it took roughly 5 seconds per query, which is too slow for my needs. Is there a faster way to do fuzzy match within Postgres? ...
Hi, Basing on your experience with Oracle, what will be the best type and settings for index that you would set on a column of DATE type? I don't necessarily need to go for partitioned index. It is a logging kind of table. You don't really care about unique id as a primary key (in fact date is close enough to be uniques most of the ...
I have a few tables with 4 to 10 rows. We don't anticipate that these tables will ever grow much more that a few more rows. Does it make sense to put an index on their primary keys. ...
I want to do the same as in this question, that is: enum DaysOfTheWeek {Sunday=0, Monday, Tuesday...}; string[] message_array = new string[number_of_items_at_enum]; ... Console.Write(custom_array[(int)DaysOfTheWeek.Sunday]); however, I would rather have something integral to so, rather than write this error prone code. Is there a bu...
I'm creating a data mart in SQL Server 2008 using SSIS for load, and SSAS for an OLAP cube. So far, everything is working great. However, I haven't created any indexes on the source database other than the default clustering on primary key. I'm pretty comfortable with designing indexes on the application databases, but since this da...
i've written a maintenance script for our database and would like to run that script on whichever tables most need vacuuming/reindexing during our down time each day. is there any way to determine that within postgres? i would classify tables needing attention like this: tables that need vacuuming tables that need reindexing (we find ...
I'm trying to choose between these query plans for a range query: Sequential table scan Bitmap index B+ tree index Hash index My instinct is that a bitmap index would work here based on what I've read. Does that sound right? ...
Very odd as follows: mysql> explain select *from online where last < now()-interval 30 second and type=1; +----+-------------+--------+------+---------------------------------------+------+---------+------+------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Ex...
select xx from tablexx where type in (1,3) and last<current-interval 30 second; select xx from tablexx where type=1; If create index on (type,last),the first one won't use index. If create index on (last,type),the second one won't use index. As for data type,which is can be seen from the example,type: int unsigned,last: datetime ...
Hi. I'm considering the use of Apache solr for indexing data in a new project. The data is made of different, independent types, which means there are for example botanicals animals cars computers to index. Should I be using different indexes for each of the types or does it make more sense to use only one index? How does using ...
I am using Lucene.Net for indexing and searching documents, and I am using the following code to create or open an index if one exists: IndexWriter writer = new IndexWriter(@"C:\index", new StandardAnalyzer(), !IndexExists); private bool IndexExists { get { return ?? } } now how can ...
What are the best practices in using Lucene.Net? or where can I find a good lucene.net usage sample? ...