Re: [PHP] PostgreSQL query taking a long time

2001-12-22 Thread Papp Gyozo
mailing list, too! btw, what version of pg do you have? - Original Message - From: K Old [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, December 21, 2001 5:51 PM Subject: [PHP] PostgreSQL query taking a long time | Hello all, | | I have a PostgreSQL database

[PHP] PostgreSQL query taking a long time

2001-12-21 Thread K Old
Hello all, I have a PostgreSQL database that is storing The Bible. It has 31,103 records in it and I have a PHP page executing this query: SELECT books.book_name, bible.chapter, bible.verse, bible.versetext FROM asv_bible bible, book_bible books WHERE bible.book = books.id ORDER BY random()

Re: [PHP] PostgreSQL query taking a long time

2001-12-21 Thread Shane Wright
Hi, You dont have the book field in the asv_bible table indexed. Use this to index it CREATE INDEX myindexname ON asv_bible(book); (the primary key fields are ok because PostgreSQL creates a unique index to implement the PRIMARY KEY constraint). Hope that helps :) -- Shane I have a