Received: by 10.52.89.73 with SMTP id bm9mr38294962vdb.3.1335869409651; Tue, 01 May 2012 03:50:09 -0700 (PDT) X-BeenThere: h2-database@googlegroups.com Received: by 10.52.88.105 with SMTP id bf9ls2182572vdb.8.gmail; Tue, 01 May 2012 03:50:08 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.33.47 with SMTP id o15mr138633vdi.9.1335869408246; Tue, 01 May 2012 03:50:08 -0700 (PDT) Authentication-Results: ls.google.com; spf=pass (google.com: domain of thomas.ege...@gmail.com designates internal as permitted sender) smtp.mail=thomas.ege...@gmail.com; dkim=pass header...@gmail.com Received: by e15g2000vbt.googlegroups.com with HTTP; Tue, 1 May 2012 03:50:08 -0700 (PDT) Date: Tue, 1 May 2012 03:50:08 -0700 (PDT) In-Reply-To: <48627d57-24ad-4100-8e9f-3f7cca58730b@w5g2000vbp.googlegroups.com> References: <4dca46c4-60c3-41af-9155-f765a76976e9@d4g2000vbn.googlegroups.com> <8508563.120.1335433553775.JavaMail.geo-discussion-forums@yndr30> <5aad1906-3acf-4edc-bd9c-8ea59f843c30@e42g2000yqa.googlegroups.com> <17830687.1959.1335443452762.JavaMail.geo-discussion-forums@vbdx11> <863AD90A-BF2E-47ED-B457-56A174471A91@gmail.com> <4fef1141-2b6a-43c6-8605-97d9a76af8f9@12g2000vba.googlegroups.com> <48627d57-24ad-4100-8e9f-3f7cca58730b@w5g2000vbp.googlegroups.com> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:11.0) Gecko/20100101 Firefox/11.0,gzip(gfe) Message-ID: Subject: Re: Huge performance problem when using OR. Much faster(500* +) when using two SELECT and UNION From: Thomas Egense To: H2 Database Content-Type: text/plain; charset=ISO-8859-1 I see no measurable improvements creating another index over both columns (LEFT,RIGHT) btw. I already need index for LEFT and RIGHT individually. Also you have to consider the column order when creating and index that spawns over several columns, depending on the data. Ie. have to most restrictive first etc. More indexes increases insert-time. If my table had 1000M instead of 10M rows, maybe the index over several columns will be faster.