Re: [SQL] Nested Sets

2005-04-16 Thread Troels Arvin
king from within a user defined function. -- Greetings from Troels Arvin, Copenhagen, Denmark ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [SQL] Nested Sets

2005-04-16 Thread Troels Arvin
On Sat, 16 Apr 2005 16:31:43 +0400, A. Kulikov wrote: > Has anyone implemented a pretty Nested Sets solution in > PostgreSQL? Maybe this is useful? : http://threebit.net/tutorials/nestedset/tutorial1.html -- Greetings from Troels Arvin, Copenhagen, Denmark ---(

[SQL] When a table was last ANALYZEd

2004-09-06 Thread Troels Arvin
Hello, Is there a way (i.e. a query in pg_catalog) to determine when a table was last ANALYZEd, if at all? -- Greetings from Troels Arvin, Copenhagen, Denmark ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL

[SQL] INFORMATION_SCHEMA and foreign keys

2004-09-05 Thread Troels Arvin
sing the INFORMATION_SCHEMA and work with the pg_catalog if I want to determine which columns are being referred to in a (set of) foreign key column(s)? (Thanks to readers who got this far.) -- Greetings from Troels Arvin, Copenhagen, Denmark ---(end of broadcast)-

Re: [SQL] SQL challenge--top 10 for each key value?

2004-04-10 Thread Troels Arvin
the big influencer in those parts of the standard.) -- Greetings from Troels Arvin, Copenhagen, Denmark ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

Re: [SQL] SQL challenge--top 10 for each key value?

2004-04-10 Thread Troels Arvin
strange query in order to get acceptable performance, see http://troels.arvin.dk/db/rdbms/#select-top-n-postgresql -- Greetings from Troels Arvin, Copenhagen, Denmark ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [SQL] Quota query with decent performance?

2003-11-18 Thread Troels Arvin
ROM pview ORDER BY age ASC LIMIT 1 OFFSET 20 -- 2=n-1 ) ) IS NOT FALSE; -- Greetings from Troels Arvin, Copenhagen, Denmark ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postg

Re: [SQL] Quota query with decent performance?

2003-11-18 Thread Troels Arvin
On Tue, 18 Nov 2003 06:56:42 -0600, Bruno Wolff III wrote: [...] > where not isfalse (age <= [...] Strange. I can't find the ISFALSE in neither PostgreSQL or standard SQL documentation. How can that be? -- Greetings from Troels Arvin, Copenhagen, Denmark ---

Re: [SQL] Quota query with decent performance?

2003-11-18 Thread Troels Arvin
-- Greetings from Troels Arvin, Copenhagen, Denmark ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [SQL] Quota query with decent performance?

2003-11-17 Thread Troels Arvin
-- Greetings from Troels Arvin, Copenhagen, Denmark ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Re: [SQL] Quota query with decent performance?

2003-11-12 Thread Troels Arvin
On Tue, 11 Nov 2003 18:49:31 -0500, Chester Kustarz wrote: > select * > from person > where age <= > (select age from person order by age limit 1 offset 2); Integrated into http://troels.arvin.dk/db/rdbms/#select-top-n -- Greetings from Troels Arvin, Cope

Re: [SQL] Quota query with decent performance?

2003-11-12 Thread Troels Arvin
On Tue, 11 Nov 2003 18:49:31 -0500, Chester Kustarz wrote: [... cut efficient top-3 youngest query wanted ...] > select * > from person > where age <= > (select age from person order by age limit 1 offset 2); Thanks - it works; why didn't I think of that? -- Greetin

[SQL] Quota query with decent performance?

2003-11-11 Thread Troels Arvin
son ) AS foo WHERE rank<=3; Test-files with table definitions and randomly generated rows: http://troels.arvin.dk/db/tests/quota.1/ Any suggestions on how to perform fast "quota queries" in PostgreSQL? -- Greetings from Troels Arvin, Copenhagen, Denmark -

Re: [SQL] Immutable attributes?

2003-07-01 Thread Troels Arvin
ction => set time_created='2003-07-01 20:56:11.393664+02'::timestamptz => where order_id=1000; -- NOTE: No change. UPDATE 1 => update transaction => set time_created='2003-07-01 20:56:00+02'::timestamptz => where order_id=1000; -- NOTE: Changed. ERROR: time_created

[SQL] Immutable attributes?

2003-07-01 Thread Troels Arvin
Hello, I have a table like this: create table test ( "test_id" serial primary key, "created" timestamp with time zone default current_timestamp check(created = current_timestamp), "some_datum" int not null ); My question concerns the "created" attribute: I want this to reflect wh