[SQL] Web Hosts (off-topic)

2000-09-13 Thread Tim Quinlan
The Hermit Hacker can ignore this (thanks). I'm looking for a web host that provides Postgres, and runs on *nix or *BSD. Does anyone have any positive, un-solicited testimonials (or visa-versa any horror stories)? If you have a story to tell me, but you don't feel that it is appropriate to post

Re: [SQL] Group by within table joins

2000-09-13 Thread Jie Liang
Hey, If you use group then except aggreate functions(count,sum..) other items in your select list should be in your group list also. Bernie Huang wrote: > Hi, I have the following SQL: > > SELECT ltb.v_id, >count(ltb.v_id) AS num_of_times_borrowed, >vtb.equip_attr[1] AS year, >

Re: [SQL] Group by within table joins

2000-09-13 Thread Josh Berkus
Mr. Huang, Seems to me that your GROUP BY line should read: GROUP BY ltb.v_id, vtb.equip_attr[1], vtb.equip_attr[3], vtb.equip_attr[4] Or am I missing the point? -Josh > SELECT ltb.v_id, >count(ltb.v_id) AS num_of_times_borrowed, >vtb.equip_attr

[SQL] Group by within table joins

2000-09-13 Thread Bernie Huang
Hi, I have the following SQL: SELECT ltb.v_id, count(ltb.v_id) AS num_of_times_borrowed, vtb.equip_attr[1] AS year, vtb.equip_attr[3] AS model, vtb.equip_attr[4] AS type FROM log_tb ltb, vehicle_tb vtb WHERE ltb.v_id=vtb.equip_id GROUP BY ltb.v_id ORDER BY year; "ERRO

Re: [SQL] Optimizing Multiply Joins ???

2000-09-13 Thread Tom Lane
Meszaros Attila <[EMAIL PROTECTED]> writes: > Changing this option in a psql session with 'set' has really helped > > But it seems, geqo_rels option is not parsed from the pg_option > file. My mistake. In 7.0 the GEQO options are set in a file "pg_geqo" in the $PGDATA direc

Re: [SQL] Optimizing Multiply Joins ???

2000-09-13 Thread Meszaros Attila
Hi, > That's interesting; apparently the regular optimizer is faster than the > GEQO optimizer for your style of query. Try increasing the GEQO > threshold (pg_option "geqo_rels") to more than 11. Changing this option in a psql session with 'set' has really helped Thanks.

Re: [SQL] PLSQL

2000-09-13 Thread Jie Liang
Hi, there, http://www.postgresql.org/doxlist.html I.10, III.45 Paulo Roberto Siqueira wrote: > Where can I find a tutorial on PL/SQL for postgres? Is there any > documentation focused on it on postgres' site? > > Thank you -- Jie LIANG Internet Products Inc. 10350 Science Cent

Re: [SQL] work on some tables in the same time.

2000-09-13 Thread Stephan Szabo
I'm assuming you want "n" to be replaced by the numbers up to the last one where there is a table1_n and table2_n, right? I'd suggest looking and PL/TCL (or if you can wait for 7.1, you can probably do it in PL/PGSQL as well with the new exec stuff.) and writing a function that does the inserts

Re: [SQL] work on some tables in the same time.

2000-09-13 Thread Ian Turner
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 > testdb=#CREATE VIEW tableselecttemp AS SELECT DISTINCT f1, f2, f3 FROM > table1_n; > ERROR: DISTINCT not supported in views In that case, you'll have to create a temporary table instead. This may actually be faster, because you only have to search

Re: [SQL] work on some tables in the same time.

2000-09-13 Thread Jerome Raupach
Thanks, but: testdb=#CREATE VIEW tableselecttemp AS SELECT DISTINCT f1, f2, f3 FROM table1_n; ERROR: DISTINCT not supported in views Jerome. Ian Turner wrote: > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > > I want to execute this query on some table2 in the same time : > > > > INS

Re: [SQL] PLSQL

2000-09-13 Thread Josh Berkus
Sr. Siquiera, > Where can I find a tutorial on PL/SQL for postgres? Is there any > documentation focused on it on postgres' site? Try: http://www.postgresql.org/users-lounge/docs/v7.0/postgres/c4091.htm -Josh -- __AGLIO DATABASE SOLUTIONS___

Re: [SQL] work on some tables in the same time.

2000-09-13 Thread Ian Turner
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 > I want to execute this query on some table2 in the same time : > > INSERT INTO table2_n(f1, f2, f3) > SELECT DISTINCT f1, f2, f3 FROM table1_n ; One way would be to do: BEGIN CREATE VIEW tableselecttemp AS SELECT DISTINCT f1, f2, f3

Re: [SQL] Optimizing Multiply Joins ???

2000-09-13 Thread Tom Lane
Meszaros Attila <[EMAIL PROTECTED]> writes: > Until we join no more than 10 tables the response time is below 0.2 s. > joining the 11th table comes with a dramatic change: response time > usually grows up to 5-7 s, That's interesting; apparently the regular optimizer is faster than the GEQO opti

[SQL] work on some tables in the same time.

2000-09-13 Thread Jerome Raupach
I want to execute this query on some table2 in the same time : INSERT INTO table2_n(f1, f2, f3) SELECT DISTINCT f1, f2, f3 FROM table1_n ; -- CREATE TABLE table1_1( INT2 f1, INT2 f2, INT2 f3, INT2 f4 ); CREATE TABLE table1_

[SQL] Optimizing Multiply Joins ???

2000-09-13 Thread Meszaros Attila
Hi all, We are building a sophisticated and flexible database structure and thus, we have quite complicated and longish queries containing lots of joins. Using only a few test records in our structure we have performed some measures, and it is hard to interpret the results. Until we join no mor