Amir Michail wrote:
Hi,

Given some condition, how do you efficiently check whether there is at
least one row that satisfies that condition?

count(*) is slow.

I too wish that count(*) were fast, at least for queries which are only using indexes. :-(

What about just doing the query and checking rs.next()? setMaxRows(1) should theoretically speed it up, but I haven't noticed performance issues which would justify setting it.

Daniel


--
Daniel Noll                            Forensic and eDiscovery Software
Senior Developer                              The world's most advanced
Nuix                                                email data analysis
http://nuix.com/                                and eDiscovery software

Reply via email to