Skip site navigation (1) Skip section navigation (2)

Planner question - "bit" data types

From: Karl Denninger <karl(at)denninger(dot)net>
To: pgsql-performance(at)postgresql(dot)org
Subject: Planner question - "bit" data types
Date: 2009-09-04 19:15:19
Message-ID: (view raw, whole thread or download thread mbox)
Lists: 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: karl.vcf
Description: text/x-vcard (124 bytes)


pgsql-performance by date

Next:From: Scott OtisDate: 2009-09-04 21:55:50
Subject: Re: Seeking performance advice and explanation for high I/O on 8.3
Previous:From: Vincent de PhilyDate: 2009-09-04 10:39:21
Subject: slow query : very simple delete, 100% cpu, nearly no disk activity

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group