On Sun, 8 Jul 2001, M.W. Koskamp wrote:
[snippage]
> You could also issue a:
> select count(keyfield)
> from sometable
> where someclause
>
> I did some benchmarks and found that is was faster then a where exists.
Hi. The original poster, here. I took four of the suggestions
that folks
x27;; Ronald J Kimball
> Cc: M.W. Koskamp; Thomas A. Lowery; [EMAIL PROTECTED]
> Subject: RE: Checking for the existence of a certain row.
>
>
>
>
> > -Original Message-
> > From: Tim Harsch [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, July 09, 2001 10:33 AM
>
On Mon, Jul 09, 2001 at 10:32:56AM -0700, Tim Harsch wrote:
>
> > Regarding Oracle, it stops after the first row that matches. I
> > tested this
> > on a table with 50 million rows, with a where clause that would select 20
> > million rows. The query returned in seconds. Here are the statistic
> -Original Message-
> From: Tim Harsch [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 09, 2001 10:33 AM
> To: Ronald J Kimball
> Cc: M.W. Koskamp; Thomas A. Lowery; [EMAIL PROTECTED]
> Subject: RE: Checking for the existence of a certain row.
>
>
>
&
I haven't seen anything on this thread related to DBI (but have
seen at least some misinformation about Oracle). Does
anyone know of some kind of 'any-db' sql list where this
would be appropriate? If so, I'd be happy to add my 2 cents
there.
-Chris
> -Original Message-
> From: Michael P
mp; Thomas A. Lowery; [EMAIL PROTECTED]
> Subject: RE: Checking for the existence of a certain row.
>
>
> Tim Harsch writes:
> >
> >
> >Don't think so, the database would clearly have to visit
> every row in order
> > to know there are none tha
Tim Harsch writes:
>
>
> Don't think so, the database would clearly have to visit every row in order
> to know there are none that match.
Wrong... at least for Sybase.
In a table with 4 million rows, doing a check on an indexed column:
select 1 from eC_user where exists (select * f
> -Original Message-
> From: Ronald J Kimball [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 09, 2001 6:33 AM
> To: Tim Harsch
> Cc: M.W. Koskamp; Thomas A. Lowery; [EMAIL PROTECTED]
> Subject: Re: Checking for the existence of a certain row.
>
>
> On Sun,
On Sun, Jul 08, 2001 at 12:52:45PM -0700, Tim Harsch wrote:
> but, does this (Sybase specific) query:
> select 1 where exists
> ( select * from some_table where some_column = 'some_value')
>
> and/or this Oracle specific query:
> select 1 from dual where exists
> ( select * from some_table where
On 2001-07-07 19:51:24 -0700, Michael A. Chase wrote:
> - Original Message -
> From: "Steve Howard" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Saturday, July 07, 2001 19:47
> Subject: RE: Checking for the
On 2001-07-07 18:16:26 -0500, Steven Lembark wrote:
> - Steve Howard <[EMAIL PROTECTED]> on 07/07/01 17:54:18 -0500:
>
> > do a
> > SELECT COUNT(*) FROM WHERE ...
> >
> > A count is almost always faster than actually returning that row, and
> > requires even less network bandwidth to return the
> -Original Message-
> From: Michael A. Chase [mailto:[EMAIL PROTECTED]]
> Sent: 08 July 2001 03:51
> To: Steve Howard; [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: Checking for the existence of a certain row.
>
>
> - Original Message -
> F
On 2001-07-08 12:52:45 -0700, Tim Harsch wrote:
> Yes,I realized,thanks. My post is to try to understand speed issues behind
> an existence query. Once I understand that better... then the portability,
> and how that will come into play in DBI, can come next. :-)
>
> So, just to reiterate, wha
is needed for complete portability.
> -Original Message-
> From: M.W. Koskamp [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, July 08, 2001 11:52 AM
> To: Tim Harsch; Thomas A. Lowery; [EMAIL PROTECTED]
> Subject: Re: Checking for the existence of a certain row.
>
>
> >
>
> SYBASE::
> select 1 where exists
> ( select * from some_table where some_column = 'some_value')
>
> Anyway, it's obviously not as portable as any of the other methods, but
I'm
> just trying to brainstorm the possibilities of the best methods for an
> existence lookup.
Most portable is:
selec
- Original Message -
From: "Steve Howard" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Saturday, July 07, 2001 19:47
Subject: RE: Checking for the existence of a certain row.
> (I'm installing Oracle on Solaris right now.
. Lowery [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, July 08, 2001 9:18 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Checking for the existence of a certain row.
>
>
> > my $statement = q{select 1 from x where exists xyz = ?};
>
> Two things, this syntax does not with Oracle
t; From: Thomas A. Lowery [mailto:[EMAIL PROTECTED]]
> > Sent: Saturday, July 07, 2001 4:57 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: Checking for the existence of a certain row.
> >
> >
> > What I do is:
> >
> > my $statement = q{select 1 from
- Original Message -
From: Steve Howard <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Sunday, July 08, 2001 4:47 AM
Subject: RE: Checking for the existence of a certain row.
> OK, one more yes-no. I tried this for performance and as exp
On Sat, Jul 07, 2001 at 09:47:22PM -0500, Steve Howard wrote:
>
> (I'm installing Oracle on Solaris right now. I'm anxious to get my hands on
> it. I've only been off of mainframes for a couple of years, and haven't used
> it, but hear some interesting things, like trim() in the where clause caus
challenges I've never thought about
having to deal with).
Anyway, just add that one to the possibilities of testing for the existence
from within a Perl script.
Steve H.
-Original Message-
From: Steven Lembark [mailto:[EMAIL PROTECTED]]
Sent: Saturday, July 07, 2001 6:16 PM
To: [E
, 2001 4:57 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Checking for the existence of a certain row.
>
>
> What I do is:
>
> my $statement = q{select 1 from x where xyz = ?};
>
> Prepare:
>
> my $exist_sth = $dbh->prepare( $statement );
>
> Then ca
What I do is:
my $statement = q{select 1 from x where xyz = ?};
Prepare:
my $exist_sth = $dbh->prepare( $statement );
Then call selectrow_array with a scalar:
$does_exists = $dbh->selectrow_array($statement, undef, $key_to_check );
Tom
On Fri, Jul 06, 2001
- Steve Howard <[EMAIL PROTECTED]> on 07/07/01 17:54:18 -0500:
> do a
> SELECT COUNT(*) FROM WHERE ...
>
> A count is almost always faster than actually returning that row, and
> requires even less network bandwidth to return the result. Of course, it a
> result of 1 is returned - the row exist
:[EMAIL PROTECTED]]
Sent: Saturday, July 07, 2001 11:54 AM
To: [EMAIL PROTECTED]
Subject: Re: Checking for the existence of a certain row.
- James Kufrovich <[EMAIL PROTECTED]> on 07/06/01 17:08:56 -0400:
> I'd like to check for the existence of data in a row of a database
>
- James Kufrovich <[EMAIL PROTECTED]> on 07/06/01 17:08:56 -0400:
> I'd like to check for the existence of data in a row of a database
> (MySQL), if given the value of a primary key. ("Is there already a row in
> the database that has this value as a key?") I don't care what data is in
>
James,
James Kufrovich wrote:
>
> Hi.
>
> I'd like to check for the existence of data in a row of a database
> (MySQL), if given the value of a primary key. ("Is there already a row in
> the database that has this value as a key?") I don't care what data is in
> the row, or if more tha
27 matches
Mail list logo