473,786 Members | 2,607 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Specifying a index

Hello !

Consider the examples bellow:

1- I create a table named TBA with columns ( A int , B char(10) )
2- I create an B-Tree index named IDXA using the column A
3- I create an GIST (or other) index named IDXB using the column A

So, I ask you:

Is it possible specify which index (IDXA or IDXB) my SELECT will use in a query ?
If so, how ?

Thanks in advance.

Marcio Caetano.
Nov 22 '05 #1
3 1368
li**********@ya hoo.com.br (Marcio Caetano) writes:
1- I create a table named TBA with columns ( A int , B char(10) )
2- I create an B-Tree index named IDXA using the column A
3- I create an GIST (or other) index named IDXB using the column A Is it possible specify which index (IDXA or IDXB) my SELECT will use in a query ?


No, not directly, but why would you create duplicate indexes? It would
be reasonable to have two indexes on the same column if they supported
different operator classes, but in that case the operator used in a
particular query would determine which index is applicable.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 22 '05 #2
Tom

In fact I'm creating two indexes (with different methods) in the same
column in order to analyze and register its performance. I need to
know wich one will be better when this table store more than
20.000.000 records.

What did you mean when you said "No, not directly" ? Is there an
indirect way of specifying a index ?

Regards,

Márcio Caetano.

tg*@sss.pgh.pa. us (Tom Lane) wrote in message news:<28******* ******@sss.pgh. pa.us>...
li**********@ya hoo.com.br (Marcio Caetano) writes:
1- I create a table named TBA with columns ( A int , B char(10) )
2- I create an B-Tree index named IDXA using the column A
3- I create an GIST (or other) index named IDXB using the column A

Is it possible specify which index (IDXA or IDXB) my SELECT will use in a query ?


No, not directly, but why would you create duplicate indexes? It would
be reasonable to have two indexes on the same column if they supported
different operator classes, but in that case the operator used in a
particular query would determine which index is applicable.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 22 '05 #3
Ben
On Tue, 03 Feb 2004 07:04:05 -0800, Marcio Caetano wrote:
Consider the examples bellow:

1- I create a table named TBA with columns ( A int , B char(10) )
2- I create an B-Tree index named IDXA using the column A
3- I create an GIST (or other) index named IDXB using the column A

So, I ask you:

Is it possible specify which index (IDXA or IDXB) my SELECT will
use in a query ?
If so, how ?


Why not:

1 - Create the table
2 - Create index of type A
3 - ANALYZE the table so the DB knows the index
4 - Time the operations of interest
5 - Drop the index
5 - Create index of type B
6 - ANALYZE the table again
7 - Time the results

Tom, wouldn't that seem to do what he wants?

???

--Ben

Nov 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1444
by: Sri | last post by:
Hi, I'm having trouble specifying the classpath (to Ant) when I'm running Ant from within a servlet. Whatever directory I try to specify, Ant is trying to build the path starting at c:\ on my Win 2K machine. I would like for the Ant to pick up CLASSPATH from my servlet's JVM; because in a true server environment I'd not know the complete path (starting at c:\) to the directory where my jars exist.
10
3263
by: Amittai Aviram | last post by:
This XHTML 1.0 Strict page -- http://www.studiolirico.org/docs/settimana2003.html has a bilingual title in Italian and English. The principle language of the page is Italian, so the <html> tag looks like this (w/o the space in the xmlns URL): <html xmlns="h ttp://www.w3.org/1999/xhtml" xml:lang="it" lang="it"> Within the body, I have English translations for all Italian text, and these are always contained within elements that bear the...
11
2934
by: Alec S. | last post by:
Hi, Is it possible to create a colored box like this? : <html> <head> <style type="text/css"> #bbb { background: #f00; position: absolute;
4
8261
by: dave | last post by:
hi all, hope someone can help.... i'm having trouble calling an SP where the ORDER BY operator is specified as a parameter when the SP is called my SP is..... CREATE PROCEDURE dbo.sp_CustSearch (@SearchFor VARCHAR(80) , @SortOrder VARCHAR(50)) AS
10
2689
by: Steve Atkins | last post by:
I have a large table (potentially tens or hundreds of millions of rows) and I need to extract some number of these rows, defined by an integer primary key. So, the obvious answer is select * from table where id in (1,3,4); But I may want to extract a large number of rows, many thousands
0
1463
by: jayaprakashbojja | last post by:
Hi, I have Two iframes in an HTML. top and bottom. The top iframe contains the code for dropdown menu. So i set z-index property to 2 so that full drop down menu shold be visible. But it's not visible. The drop down menu is going below the bottom iframe. Let me know the solution for this. thanks in advance. The code is as follows.
6
18746
by: Eric | last post by:
Hello, I have code similar to: if (beforeToday(document.forms.sStartDate.value)) that was broken when an include file had a form added to it. Since my form was no longer the 0th form, my code was broken. Is there any way to specify a form by name or some other work around for this situation?
1
5160
by: zufie | last post by:
Hi, I want to specifying a foreign key by altering a table. First, I create an ORDERS table without specifying a foreign key. Here is my code: CREATE TABLE ORDERS (Order_ID integer, Order_Date date, Customer_SID integer,
4
1910
by: =?Utf-8?B?U2FuZHBvaW50R3V5?= | last post by:
I have a dropdown of states that is populated from a table, that looks like ddlb.DataValueField="StateCode" // ex: FL ddlb.DataTextField="StateDescription" // ex: Florida If I want to set the initial value I can use ddlb.SelectedValue="Florida" In other words, SelectedValue is the DataTextField How do I set the initial value to the DataValueField? ddlb.SelectedValue="FL" doesnt work (or is it just me?)
0
9647
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10164
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9961
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8989
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6745
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5534
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3669
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.