Re: [SQL] Optimizing Query

2001-03-06 Thread Tom Lane
Justin Long <[EMAIL PROTECTED]> writes: > Wow. I can't believe the difference. It didn't take too long. I'll set up a > script in my etc/cron.weekly to run it... would there be any benefit to > doing a vacuum analyze nightly? Depends. A nightly vacuum is probably good practice, but you could s

Re: [SQL] Optimizing Query

2001-03-06 Thread Justin Long
Wow. I can't believe the difference. It didn't take too long. I'll set up a script in my etc/cron.weekly to run it... would there be any benefit to doing a vacuum analyze nightly? Justin Long At 11:10 PM 3/5/2001 -0500, you wrote: Justin Long <[EMAIL PROTECTED]> writes: > Ok, now I have another

Re: [SQL] Optimizing Query

2001-03-05 Thread Tom Lane
Justin Long <[EMAIL PROTECTED]> writes: > Ok, now I have another question... it doesn't seem to be accessing the index. > explain select k.kbid,k.title from knowledge k , kbwords w0 , kbwords w1 > WHERE ((k.kbid=w0.kbid and w0.wordid=42743) AND (k.kbid=w1.kbid and > w1.wordid=85369)) > NOTICE:

Re: [SQL] Optimizing Query

2001-03-05 Thread Mathijs Brands
On Mon, Mar 05, 2001 at 04:59:47PM -0500, Justin Long allegedly wrote: > Ok, now I have another question... it doesn't seem to be accessing the index. > > explain select k.kbid,k.title from knowledge k , kbwords w0 , kbwords w1 > WHERE ((k.kbid=w0.kbid and w0.wordid=42743) AND (k.kbid=w1.kbid an

Re: [SQL] Optimizing Query

2001-03-05 Thread Michael Fork
Did you run VACUUM ANALYZE after running CLUSTER? Michael Fork - CCNA - MCP - A+ Network Support - Toledo Internet Access - Toledo Ohio On Mon, 5 Mar 2001, Justin Long wrote: > Ok, now I have another question... it doesn't seem to be accessing the index. > > explain select k.kbid,k.title from

Clustering (was Re: [SQL] Optimizing Query)

2001-03-05 Thread Mathijs Brands
On Mon, Mar 05, 2001 at 04:45:47PM -0500, Bruce Momjian allegedly wrote: > Yes. > > > On Mon, Mar 05, 2001 at 04:07:57PM -0500, Bruce Momjian allegedly wrote: > > > Have you tried VACUUM ANALYZE and CLUSTER? > > > > I assume CLUSTER still drops all indexes except the one you're clustering > > on

Re: [SQL] Optimizing Query

2001-03-05 Thread Justin Long
Ok, now I have another question... it doesn't seem to be accessing the index. explain select k.kbid,k.title from knowledge k , kbwords w0 , kbwords w1 WHERE ((k.kbid=w0.kbid and w0.wordid=42743) AND (k.kbid=w1.kbid and w1.wordid=85369)) NOTICE:  QUERY PLAN: Merge Join  (cost=32339.30..35496.97

Re: [SQL] Optimizing Query

2001-03-05 Thread Justin Long
Yes, it drops indexes, much to my chagrin, as I just realized ... including SERIALs... Justin At 04:45 PM 3/5/2001 -0500, you wrote: Yes. > On Mon, Mar 05, 2001 at 04:07:57PM -0500, Bruce Momjian allegedly wrote: > > Have you tried VACUUM ANALYZE and CLUSTER? > > I assume CLUSTER still drops a

Re: [SQL] Optimizing Query

2001-03-05 Thread Justin Long
Does that mean that if you have 3 indexes on a table and you cluster one, it deletes the other 2? At 04:45 PM 3/5/2001 -0500, you wrote: Yes. > On Mon, Mar 05, 2001 at 04:07:57PM -0500, Bruce Momjian allegedly wrote: > > Have you tried VACUUM ANALYZE and CLUSTER? > > I assume CLUSTER still drop

Re: [SQL] Optimizing Query

2001-03-05 Thread Bruce Momjian
Yes. > On Mon, Mar 05, 2001 at 04:07:57PM -0500, Bruce Momjian allegedly wrote: > > Have you tried VACUUM ANALYZE and CLUSTER? > > I assume CLUSTER still drops all indexes except the one you're clustering > on? > > Mathijs > -- > It's not that perl programmers are idiots, it's that the languag

Re: [SQL] Optimizing Query

2001-03-05 Thread Mathijs Brands
On Mon, Mar 05, 2001 at 04:07:57PM -0500, Bruce Momjian allegedly wrote: > Have you tried VACUUM ANALYZE and CLUSTER? I assume CLUSTER still drops all indexes except the one you're clustering on? Mathijs -- It's not that perl programmers are idiots, it's that the language rewards idiotic behavi

Re: [SQL] Optimizing Query

2001-03-05 Thread Bruce Momjian
Have you tried VACUUM ANALYZE and CLUSTER? > Any suggestions welcome! > > Here is my query: > > select k.*, c.category from knowledge k, kb_categories c , kbwords w0 , > kbwords w1 WHERE k.catid=c.catid AND ((k.kbid=w0.kbid and w0.wordid=42743) > AND (k.kbid=w1.kbid and w1.wordid=85369)) ORD

[SQL] Optimizing Query

2001-03-05 Thread Justin Long
Any suggestions welcome! Here is my query: select k.*, c.category from knowledge k, kb_categories c , kbwords w0 , kbwords w1 WHERE k.catid=c.catid AND ((k.kbid=w0.kbid and w0.wordid=42743) AND (k.kbid=w1.kbid and w1.wordid=85369)) ORDER BY k.kbid DESC LIMIT 25; Now for the details knowledge k