Just discovered, I can’t use GIST over character varying... Any other tips on how to optimize the query? Here are about 1,000,000 (one million) records in this table, table scan takes about 5 to 6 seconds on actual hardware (SAS, 1 Xeon, 2Gb memory on CentOS with all normal performance hacks). select * from notafiscal where numeroctc like ‘POA%34345’; Thanks, Edson. De: pgsql-general-owner@xxxxxxxxxxxxxx [mailto:pgsql-general-owner@xxxxxxxxxxxxxx] Em nome de Edson Carlos Ericksson Richter Thanks for the tip, unfortunately, split it does not work for me, since it’s a free text field, that users fill as they wish... But looking most slow queries, this one pops up with more frequency... So GIST would work; I’ll give a try. Regards, Edson. De: pgsql-general-owner@xxxxxxxxxxxxxx [mailto:pgsql-general-owner@xxxxxxxxxxxxxx] Em nome de Gregg Jaskiewicz You can always store it divided in the database into two columns. Gist could also work for you. |
<<attachment: smime.p7s>>