Does the planner know how to use indices to optimize these queries?
For reference, I was having SEVERE performance problems with the
following comparison in an SQL statement where "mask" was an integer:
"select ... from .... where ...... and (permission & mask = permission)"
This resulted in the planner deciding to run a nested loop and
extraordinarily poor performance.
I can probably recode the application to use a field of type "bit(32)"
and either cast to an integer or have the code do the conversion
internally (its just a shift eh?)
The question is whether the above statement will be reasonably planned
if "mask" is a bit type.
-- Karl Denninger
Description: text/x-vcard (124 bytes)
pgsql-performance by date
|Next:||From: Scott Otis||Date: 2009-09-04 21:55:50|
|Subject: Re: Seeking performance advice and explanation for high I/O on 8.3|
|Previous:||From: Vincent de Phily||Date: 2009-09-04 10:39:21|
|Subject: slow query : very simple delete, 100% cpu, nearly no disk activity|