Planner question - "bit" data types - Mailing list pgsql-performance

From Karl Denninger
Subject Planner question - "bit" data types
Date
Msg-id 4AA16747.50100@denninger.net
Whole thread Raw
Responses Re: Planner question - "bit" data types  (Josh Berkus <josh@agliodbs.com>)
List pgsql-performance
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

Attachment

pgsql-performance by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: Seeking performance advice and explanation for high I/O on 8.3
Next
From: "Scott Otis"
Date:
Subject: Re: Seeking performance advice and explanation for high I/O on 8.3