What indexes do you have on these tables?And have you ANALYZEd all three recently? --Thomas F. O'ConnellCo-Founder, Information ArchitectSitening, LLCOpen Source Solutions. Optimized Web Development.http://www.sitening.com/110 30th Avenue North, Suite 6Nashville, TN
of your options.
--
Thomas F. O'Connell
Co-Founder, Information Architect
Sitening, LLC
Strategic Open Source: Open Your i™
http://www.sitening.com/
110 30th Avenue North, Suite 6
Nashville, TN 37203-6320
615-469-5150
615-469-5151 (fax)
On Sep 29, 2005, at 1:16 PM, Mario Splivalo wrote:
I can assign
how you'd do it
without using a PL, but you could still build your IN clause
programmatically.
--
Thomas F. O'Connell
Co-Founder, Information Architect
Sitening, LLC
Strategic Open Source: Open Your i™
http://www.sitening.com/
110 30th Avenue North, Suite 6
Nashville, TN 37203-6320
615-469
Well, browse through this list:
http://www.postgresql.org/docs/books/
I can't make any recommendations, as I am fairly familiar with the
online documentation, which, when supported by the community, seems
to be pretty good.
--
Thomas F. O'Connell
Co-Founder, Information Architect
Sitening
know to be safe or passing in safe values generated elsewhere in the
application, you're less likely to need to quote your variables
explicitly or to build queries dynamically.
--
Thomas F. O'Connell
Co-Founder, Information Architect
Sitening, LLC
Strategic Open Source: Open Your i™
http
Is there a reason not to build it in as a sub-query?E.g., if you have a function get_count( int ): SELECT count(b_column)FROM some_tableWHERE some_field_1 in ( SELECT a_column FROM a_table WHERE some_condition)AND some_field_2 = $2; --Thomas F. O'ConnellCo-Founder, Information
This doesn't give me quite what I'm looking for because I need there
to be only one of each possible value of seq2 to be returned for each
value of fkey.
--
Thomas F. O'Connell
Co-Founder, Information Architect
Sitening, LLC
Strategic Open Source: Open Your i™
http://www.sitening.com/
110
seems like it works, but it is abominably slow, running on the order of days across 1.5 million rows rather than the seconds (or preferably milliseconds) I'd prefer.I have this annoying feeling that I'm overlooking a reasonably efficient in-between query.-- Thomas F. O'Connell Co-Founder, Information
You should be able to use the CURRENT_DATE function in place of sysdate.
You might need to cast the 1 explicitly to an interval.
As in:
CURRENT_DATE - '1 day'::interval
-tfo
--
Thomas F. O'Connell
Co-Founder, Information Architect
Sitening, LLC
http://www.sitening.com/
110 30th Avenue North, Suite
Yup. Got it. Wasn't thinking clearly about what expression meant.
Thanks!
-tfo
--
Thomas F. O'Connell
Co-Founder, Information Architect
Sitening, LLC
http://www.sitening.com/
110 30th Avenue North, Suite 6
Nashville, TN 37203-6320
615-260-0005
On Feb 23, 2005, at 2:33 PM, Bruno Wolff III wrote
As far as I know, you didn't post your actual table definitions (or
full queries) earlier, so I'm not exactly sure what you mean.
-tfo
--
Thomas F. O'Connell
Co-Founder, Information Architect
Sitening, LLC
http://www.sitening.com/
110 30th Avenue North, Suite 6
Nashville, TN 37203-6320
615-260
Have you looked at the documentation on triggers?
-tfo
--
Thomas F. O'Connell
Co-Founder, Information Architect
Sitening, LLC
http://www.sitening.com/
110 30th Avenue North, Suite 6
Nashville, TN 37203-6320
615-260-0005
On Jan 23, 2005, at 11:23 AM, Klaus W. wrote:
Hi!
Because i got no answer
.
-tfo
--
Thomas F. O'Connell
Co-Founder, Information Architect
Sitening, LLC
http://www.sitening.com/
110 30th Avenue North, Suite 6
Nashville, TN 37203-6320
615-260-0005
On Nov 17, 2004, at 8:52 AM, Stephan Szabo wrote:
On Tue, 16 Nov 2004, Thomas F.O'Connell wrote:
Hmm. I was more interested
?
Furthermore, is there a better way of performing this sort of operation
in postgres (or just in SQL in general)?
Thanks!
-tfo
--
Thomas F. O'Connell
Co-Founder, Information Architect
Sitening, LLC
http://www.sitening.com/
110 30th Avenue North, Suite 6
Nashville, TN 37203-6320
615-260-0005
This is untested, but it might be enough to get you started:
SELECT namecounter
FROM name n
WHERE NOT EXISTS (
SELECT 1
FROM name
WHERE hh 0
AND famnu = n.famnu
)
GROUP BY famnu
HAVING birthdate = min( birthdate );
What I'm trying to do here is grab all families
A query that should get the job done is:
SELECT registration_id
FROM registrations r
WHERE NOT EXISTS (
SELECT 1
FROM receipts
WHERE registration_id = r.registration_id
);
There might be a more efficient version with JOINs that don't require a
subquery, but this should get
One way to do this is to use the column_info database handle method.
Here's a little perl script that accepts a table name as an argument
and returns the column names:
#!/usr/bin/perl
use DBI;
use strict;
my( $database, $table ) = @ARGV;
my $dbh = DBI-connect( dbi:Pg:dbname=$database, 'postgres'
i think i might've stumbled across a tiny defect in the optimizer.
unfortunately, i haven't the knowledge of the code to know where to
begin looking at how to address this problem.
anyway, consider the following:
create table foo(
id int2
);
create table bar(
id int2
from the docs, i know that if you have two tables, foo and bar, you can
write a query such as
select f.bling
from foo f
where f.id = (
select max( b.id )
from bar b
where b.bling = i kiss you!
);
what i'm wondering is if you need that subquery in two places in a query
19 matches
Mail list logo