dbTalk Databases Forums  

Question about indexes

comp.databases.postgresql.general comp.databases.postgresql.general


Discuss Question about indexes in the comp.databases.postgresql.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Stefano Bonnin
 
Posts: n/a

Default Question about indexes - 11-15-2004 , 04:38 AM






Only a simple question

I have a table with

primarykey(field1,field2,field3)

and I want to execure a query like

select * from my_table where field1 = some_value

if I define an index on field1, I increase the query performace or not?

Thanks

Reply With Quote
  #2  
Old   
Dawid Kuroczko
 
Posts: n/a

Default Re: Question about indexes - 11-15-2004 , 04:53 AM






On Mon, 15 Nov 2004 11:38:29 +0100, Stefano Bonnin
<stefano.bonnin (AT) comai (DOT) to> wrote:
Quote:
Only a simple question

I have a table with

primarykey(field1,field2,field3)

and I want to execure a query like

select * from my_table where field1 = some_value

if I define an index on field1, I increase the query performace or not?
You increase it a bit. Anyway its not worth the hassle, as increase is
rather marginal, and having two indexes lessens the chance that
they'll be served from cache.

If you're not sure yet, just make some tests.

Regards,
Dawid

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.