Pavel Stehule wrote:
On 11/12/2007, Gerry Reno <[EMAIL PROTECTED]> wrote:
Ok, I've been playing around with this SQL some more and I found that if
I remove this:
e.active = '1'
from the query that the query now completes in 5 seconds. Nothing else
has anywhere near the impact of this boolean
Hello
there is diference in agg position. Send, please, query and explain
analyze output. And test id = any (... ) looks like hard
denormalisation and can do problems. This condition can be slow and
for large arrays is better use multivalues.
SELECT *
FROM tab
WHERE x IN (VALUES(10),(20));
I see that I can create a table with a mixed case name as long as the name is
wrapped in quotes. Is there a setting to allow upper case and mixed case names
for database tables, fields, etc, without having to wrap each in quotes?
Thanks,
SteveE
am Tue, dem 11.12.2007, um 11:05:25 -0600 mailte Ertel, Steve folgendes:
> 
> I see that I can create a table with a mixed case name as long as the name is
> wrapped in quotes. Is there a setting to allow upper case and mixed case
> names
> for database tables, fields, etc, without having to
On Tue, Dec 11, 2007 at 11:05:25AM -0600, Ertel, Steve wrote:
> is wrapped in quotes. Is there a setting to allow upper case and mixed
> case names for database tables, fields, etc, without having to wrap each
> in quotes?
No, sorry. The always-one-case rule for unquoted identifiers is ANSI
con
Ertel, Steve wrote:
I see that I can create a table with a mixed case name as long as the
name is wrapped in quotes. Is there a setting to allow upper case
and mixed case names for database tables, fields, etc, without having
to wrap each in quotes?
No, SQL defines identifiers as case-insensit
Pavel Stehule wrote:
Hello
there is diference in agg position. Send, please, query and explain
analyze output. And test id = any (... ) looks like hard
denormalisation and can do problems. This condition can be slow and
for large arrays is better use multivalues.
SELECT *
FROM tab
WHERE x
I have a table in which people will have a number of questions to
answer. I want those pk to be placed in my user table. So if a user
answers three question I want those 3 pk's in the user table (fk).
What should I be doing?
Thanks in advance,
J
---(end of broadcast)
On Dec 11, 2007, at 12:20 PM, PostgreSQL Admin wrote:
I have a table in which people will have a number of questions to
answer. I want those pk to be placed in my user table. So if a user
answers three question I want those 3 pk's in the user table (fk).
What should I be doing?
You're goi
am Tue, dem 11.12.2007, um 13:20:52 -0500 mailte PostgreSQL Admin folgendes:
> I have a table in which people will have a number of questions to
> answer. I want those pk to be placed in my user table. So if a user
> answers three question I want those 3 pk's in the user table (fk).
> What s
This is my layout so far:
CREATE TABLE users (
id serial NOT NULL,
--question REFERENCES questions(id) ON DELETE CASCADE ## ON REMOVED##
);
CREATE TABLE questions (
id serial NOT NULL,
questions varchar(450) NOT NULL
);
CREATE TABLE answers (
id serial NOT NULL,
question_id int REFERENCES questi
PostgreSQL Admin wrote:
> This is my layout so far:
>
> CREATE TABLE users (
> id serial NOT NULL,
> --question REFERENCES questions(id) ON DELETE CASCADE ## ON REMOVED##
> );
>
> CREATE TABLE questions (
> id serial NOT NULL,
> questions varchar(450) NOT NULL
> );
>
> CREATE TABLE answers (
> i
Hello
1) increase statistics on res_partner_address.type (about 100)
alter table ...
ALTER [ COLUMN ] column SET STATISTICS integer
do analyze, and look again on plans. There are difference
-> Seq Scan on res_partner_address a (cost=0.00..88.40
rows=16 width=552) (actual time=0.106..3.
am Tue, dem 11.12.2007, um 14:12:38 -0500 mailte PostgreSQL Admin folgendes:
> This is my layout so far:
> [ table-layout]
> ...
> Does this look correct?
Yes, why not? Do you have problems? Which? I can't see problems, it's a
normalized design IMHO.
Andreas
--
Andreas Kretschmer
Kontakt: Hey
No problems with the design - I was not thinking with the DB hat on at
first. I have been working on clustering for a while... just adjusting.
Thanks everyone.
:)
---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings
I have a table of account balances as at the end of a working day and
want to from that, calculate daily total figures.
Eg, let's say I have a table structure of:
year_id integer
month_id integer
working_day integer
account integer
account_balance numeric(19,4)
Example data might be something l
Gerry Reno <[EMAIL PROTECTED]> writes:
> Pavel Stehule wrote:
>> there is diference in agg position. Send, please, query and explain
>> analyze output.
[ explain analyze output ]
The rowcount estimates seem pretty far off, even for simple cases that
I'd expect it to get right, eg
> ->
I have a function which uses execute to populate the value of a variable
based on a defined select construct.
The relevant part of the code looks like thus:
EXECUTE curr_query INTO curr_amount;
RAISE NOTICE '%',curr_amount;
IF NOT FOUND THEN
curr_amount=0;
END IF;
RAISE NOTI
Paul Lambert <[EMAIL PROTECTED]> writes:
> The relevant part of the code looks like thus:
> EXECUTE curr_query INTO curr_amount;
> RAISE NOTICE '%',curr_amount;
> IF NOT FOUND THEN
>curr_amount=0;
> END IF;
> ... which suggests to me that although the
> execute has populat
On Dec 11, 2007, at 11:15 PM, Paul Lambert wrote:
I have a function which uses execute to populate the value of a
variable based on a defined select construct.
The relevant part of the code looks like thus:
EXECUTE curr_query INTO curr_amount;
RAISE NOTICE '%',curr_amount;
IF NOT FO
Tom Lane wrote:
Do you really need an EXECUTE? If so, maybe you could restructure this
using a FOR ... IN EXECUTE, or some such thing.
I'll always only ever have a single result since the function gets
passes all the fields making up the primary key of the table, so doing a
for in seems like
am Wed, dem 12.12.2007, um 10:34:35 +0900 mailte Paul Lambert folgendes:
> I have a table of account balances as at the end of a working day and
> want to from that, calculate daily total figures.
>
> Eg, let's say I have a table structure of:
> year_id integer
> month_id integer
> working_day i
A. Kretschmer wrote:
am Wed, dem 12.12.2007, um 10:34:35 +0900 mailte Paul Lambert folgendes:
year_id integer
month_id integer
working_day integer
Why this broken data types? We have date and timestamp[tz].
It's a financial application which needs to work using a concept of
'financial pe
am Wed, dem 12.12.2007, um 15:39:48 +0900 mailte Paul Lambert folgendes:
> A. Kretschmer wrote:
> >am Wed, dem 12.12.2007, um 10:34:35 +0900 mailte Paul Lambert folgendes:
> >>year_id integer
> >>month_id integer
> >>working_day integer
> >
> >Why this broken data types? We have date and timestam
24 matches
Mail list logo