Re: [SQL] Creating Index

2003-10-02 Thread CN
. Again, I would much appreciate any idea helping me speed up view1. One off-topic issue is that I wish postgresql could be smarter to make use of the index even there are INT2 columns in composit index. As my case shows, INT2 is big enough for columns year and month, isn't it? Best Regards, CN

Re: [SQL] Creating Index

2003-10-02 Thread CN
=0 loops=1) Filter: (c1 2003) Total runtime: 41.86 msec Best Regards, CN -- http://www.fastmail.fm - mmm... Fastmail... ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] Creating Index

2003-10-02 Thread CN
well under control by the fingers of you genious developers! Long live the king! Ooops! I'm sorry! Please pardon my English! Long live postgreSQL, the no. 1 DBMS, and its masters - the developers! Best Regards, CN -- http://www.fastmail.fm - Email service worth paying for. Try it for free

Re: [SQL] Creating Index

2003-10-02 Thread CN
Hi! I thought I have got no more question in this thread, and I was wrong :-( Is the extra 300ms in UNION essential? Best Regards, CN --This table contains 1036 rows. CREATE TABLE table1 ( c1 VARCHAR(20) PRIMARY KEY, c2 char )WITHOUT OIDS; - --This table contains 9429 rows

[SQL] Creating Index

2003-10-01 Thread CN
not smart enough to apply its usage explained in the manual. I would much appreciate if anyone could show me how to build that index something similar to (I guess) the following query (which is illegal of course): CREATE INDEX index1 ON table1 EXTRACT(YEAR FROM d) || EXTRACT(MONTH FROM d); TIA CN

Re: [SQL] Creating Index

2003-10-01 Thread CN
Peter, Thanks a lot! Unqualified count() cannot use an index because it has to visit all the rows in the table. It is only for my test. In my real practice, queries like SELECT * FROM view1 WHERE year = 2003 AND month BETWEEN 10 AND 12 will be performed. Then again, I don't quite believe

Re: [SQL] Creating Index

2003-10-01 Thread CN
width=156) (actual time=0.03..0.03 rows=0 loops=1) - Seq Scan on table3 (cost=0.00..0.00 rows=1 width=156) (actual time=0.01..0.01 rows=0 loops=1) Total runtime: 5114.47 msec (13 rows) Thanks again! Gurus. Regards, CN -- http://www.fastmail.fm

Re: [SQL] Creating Index

2003-10-01 Thread CN
(YEAR FROM d)::TEXT || EXTRACT(MONTH FROM d)::TEXT Is creating a function that eats DATE as argument to build that index my only solution? Best Regards, CN -- http://www.fastmail.fm - The professional email service ---(end of broadcast)--- TIP 3

Re: [SQL] help with rule and notification

2003-10-01 Thread CN
server in 3 tier environment is not too difficult. Regards, CN -- http://www.fastmail.fm - Or how I learned to stop worrying and love email again ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [SQL] Extraordinary Full Join

2003-04-06 Thread CN
, the correct result for the worst case like: id | name | book | hobby ---+--++--- m1 | John | book1 | m1 | John || hobby2 m1 | John | book2 | m1 | John || hobby1 Regards, CN -- http://www.fastmail.fm - Choose from over 50 domains or use your own

[SQL] Extraordinary Full Join

2003-04-05 Thread CN
+--++--- m1 | John | book1 |hobby1 m1 | John | book2 |hobby2 What is the better-have SQL to produce the last furnished list? TIA CN -- http://www.fastmail.fm - Choose from over 50 domains or use your own ---(end of broadcast)--- TIP 3

[SQL] Which Approach Performs Better?

2003-03-24 Thread CN
! Regards, CN -- http://www.fastmail.fm - A no graphics, no pop-ups email service ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

[SQL] How To Get Bytea Data Instead Of Its Oid

2002-09-19 Thread CN LIOU
Greetings! I must have missed lesson 1 of postgresql! create table test (c1 text,c2 bytea); Then, I probably have successfullyi nserted several records into test using C++Builder. Now I am trying to retrieve back the binary data in c2 I just inserted. However, the SQL statement issued by