473,396 Members | 2,029 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 1346
li**********@yahoo.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**********@yahoo.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
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...
10
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...
11
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
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...
10
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 *...
0
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...
6
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...
1
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,...
4
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...
0
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...
0
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,...

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.