Re: [PERFORM] is it possible to get the optimizer to use indexes

2003-12-24 Thread Dave Cramer
Doug, Yes, it does depend on the locale, you can get around this in 7.4 by building the index with smart operators Dave On Thu, 2003-12-18 at 20:38, Doug McNaught wrote: > Christopher Kings-Lynne <[EMAIL PROTECTED]> writes: > > >> It appears that the optimizer only uses indexes for = clause? > >

Re: [PERFORM] is it possible to get the optimizer to use indexes

2003-12-22 Thread Doug McNaught
Christopher Kings-Lynne <[EMAIL PROTECTED]> writes: >> It appears that the optimizer only uses indexes for = clause? > > The optimizer will used indexes for LIKE clauses, so long as the > clause is a prefix search, eg: > > SELECT * FROM test WHERE a LIKE 'prf%'; Doesn't this still depend on your

Re: [PERFORM] is it possible to get the optimizer to use indexes

2003-12-19 Thread Erki Kaldjärv
Hello, i got indexes to work with "text_pattern_ops" for locale et_EE. So instead of: create index some_index_name on some_table(some_text_field); nor create index some_index_name on some_table(some_text_field text_ops); try to create index as follows: create index some_index_name on some_

Re: [PERFORM] is it possible to get the optimizer to use indexes

2003-12-19 Thread Tom Lane
Dave Cramer <[EMAIL PROTECTED]> writes: > So even in a north-american locale, such as en_CA this will be a > problem? If it's not "C" we won't try to optimize LIKE. I know en_US does not work (case-insensitive, funny rules about spaces, etc) and I would expect en_CA has the same issues. If you'r

Re: [PERFORM] is it possible to get the optimizer to use indexes

2003-12-19 Thread Dave Cramer
So even in a north-american locale, such as en_CA this will be a problem? Dave On Thu, 2003-12-18 at 22:44, Tom Lane wrote: > Dave Cramer <[EMAIL PROTECTED]> writes: > > after vacuum verbose analyze, I still get [a seqscan] > > The other gating factor is that you have to have initdb'd in C locale

Re: [PERFORM] is it possible to get the optimizer to use indexes

2003-12-18 Thread Tom Lane
Dave Cramer <[EMAIL PROTECTED]> writes: > after vacuum verbose analyze, I still get [a seqscan] The other gating factor is that you have to have initdb'd in C locale. Non-C locales tend to use wild and wooly sort orders that are not compatible with what LIKE needs. regards

Re: [PERFORM] is it possible to get the optimizer to use indexes

2003-12-18 Thread Stephan Szabo
On Thu, 18 Dec 2003, Dave Cramer wrote: > after vacuum verbose analyze, I still get > > explain select * from isppm where item_upc_cd like '06038301234'; > QUERY PLAN > --- > Seq Scan on isppm (cos

Re: [PERFORM] is it possible to get the optimizer to use indexes with a like clause

2003-12-18 Thread Christopher Browne
[EMAIL PROTECTED] (Dave Cramer) wrote: > It appears that the optimizer only uses indexes for = clause? It can use indices only if there is a given prefix. Thus: where text_field like 'A%' can use the index, essentially transforming this into the clauses where text_field >= 'A' and

Re: [PERFORM] is it possible to get the optimizer to use indexes

2003-12-18 Thread Dave Cramer
after vacuum verbose analyze, I still get explain select * from isppm where item_upc_cd like '06038301234'; QUERY PLAN --- Seq Scan on isppm (cost=1.00..19684.89 rows=2 width=791) Fil

Re: [PERFORM] is it possible to get the optimizer to use indexes

2003-12-18 Thread Christopher Kings-Lynne
It appears that the optimizer only uses indexes for = clause? The optimizer will used indexes for LIKE clauses, so long as the clause is a prefix search, eg: SELECT * FROM test WHERE a LIKE 'prf%'; Chris ---(end of broadcast)--- TIP 4: Don't 'kil