From: soni de <soni.de@gmail.com>
To: Dawid Kuroczko <qnex42@gmail.com>
To: A. Kretschmer <andreas.kretschmer@schollglas.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Regarding Bitmap Scan
Date: Fri, 27 Oct 2006 18:42:35 +0530
Message-ID: <9f2e40a90610270612r75d9f52dh4aaf561995d42bd6@mail.gmail.com> (raw)
In-Reply-To: <758d5e7f0610170527p8503c1xf51fdfea2742daa1@mail.gmail.com>
References: <9f2e40a90610170439n4b670c23ld586e4f0840e943@mail.gmail.com>
<758d5e7f0610170527p8503c1xf51fdfea2742daa1@mail.gmail.com>
Thanks a lot for your help.
Thanks,
Soni
On 10/17/06, Dawid Kuroczko <qnex42@gmail.com> wrote:
>
> On 10/17/06, soni de <soni.de@gmail.com> wrote:
> >
> > I didn't understand the "Bitmap Scan" and the sentence "indexes will be
> > dynamically converted to bitmaps in memory". What does mean by "Bitmap Scan"
> > in database?
> >
> >
> >
> > Can anybody help us regarding above query?
> >
>
> Assume you have a table:
> CREATE TABLE foo (
> some_key int,
> some_time timestamp with time zone,
> some_data text
> );
> And two indexes:
> CREATE INDEX foo_key ON foo (some_key);
> CREATE INDEX foo_time ON foo (some_time);
>
> Now, you make a query:
> SELECT * from foo WHERE some_key > 10 AND some_time >
> '2006-10-01'::timestamptz;
>
> ...originally planner would choose only one index to use -- and would use
> the
> one which it think its best.
>
> The 8.1 version does differently: It will scan foo_key index -- make a
> bitmap out of it,
> scan foo_time index -- make another bitmap out of it, binary AND these
> bitmaps,
> and will read the data from the table using such combined bitmap. It
> could as well
> use "OR" if you used OR in your query.
>
> Hence -- it can be faster, especially for large tables and selective
> queries.
>
> Regards,
> DAwid
>
>
>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: soni.de@gmail.com, qnex42@gmail.com, andreas.kretschmer@schollglas.com
Subject: Re: Regarding Bitmap Scan
In-Reply-To: <9f2e40a90610270612r75d9f52dh4aaf561995d42bd6@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox