<html><div style='background-color:'><P><FONT face="Geneva, Arial, Sans-serif" size=2>Hi,</FONT></P>
<P><FONT face="Geneva, Arial, Sans-serif" size=2>I´ve already created an concatenated index in Postgres V3.0 with different datatypes:</FONT></P>
<P><FONT face="Geneva, Arial, Sans-serif"><FONT size=2><FONT color=#0000ff>CREATE</FONT> <FONT color=#ff0000>INDEX</FONT> mov_i4 <FONT color=#008000>ON</FONT> movimiento <FONT color=#008000>USING</FONT> btree (id_company, id_status, id_docum, id_origen_mov);</FONT></FONT></P>
<P><FONT face="Geneva, Arial, Sans-serif" size=2>id_company int2</FONT></P>
<P><FONT face="Geneva, Arial, Sans-serif" size=2>id_status char(1)</FONT></P>
<P><FONT face="Geneva, Arial, Sans-serif" size=2>id_docum numeric(15,0)</FONT></P>
<P><FONT face="Geneva, Arial, Sans-serif" size=2>id_origen_mov int4</FONT></P>
<P><FONT face="Geneva, Arial, Sans-serif" size=2>and after several tests the query doesn´t use the index because it seems that id_company must be a char.</FONT></P>
<P><FONT face="Geneva, Arial, Sans-serif" size=2>If a use the value for the id_company eg. select * from movimiento where id_company = <FONT color=#ff0000>120</FONT></FONT></P>
<P><FONT face="Geneva, Arial, Sans-serif" size=2> and id_status = 'X' and id_docto = 10000056789 and mount = 12345.56</FONT></P>
<P><FONT face="Geneva, Arial, Sans-serif" size=2>---- it doesn´t use the index </FONT></P>
<P><FONT face="Geneva, Arial, Sans-serif" size=2>If a use the value for the id_company eg. select * from movimiento where id_company = <FONT color=#ff0066>'120' </FONT>and</FONT></P>
<P><FONT face="Geneva, Arial, Sans-serif" size=2> and id_status = 'X' and id_docto = 10000056789 and mount = 12345.56</FONT></P>
<P><FONT face="Geneva, Arial, Sans-serif" size=2>---- it uses the index</FONT></P>
<P> </P>
<P><FONT face="Geneva, Arial, Sans-serif" size=2>The problem is that I can´t change the datatypes in the hole application and the table has 240,000 rows and we need to use concatenated indexes, because we access the table in different ways, the table has another five concatenated indexes.</FONT></P>
<P><FONT face=Arial size=2>Could you suggest something to resolve this?</FONT></P>
<P><FONT face=Arial size=2>Thank you very much.</FONT></P>
<P><FONT face=Arial size=2>Regards,</FONT></P>
<P><FONT face=Arial size=2>Cecilia</FONT></P>
<P> </P>
<DIV> </DIV></div><br clear=all><hr>Únete al mayor servicio mundial de correo electrónico: <a href="http://g.msn.com/8HMWESMX/2755">Haz clic aquí </a> </html>