Re: [HACKERS] some points for FAQ

2007-10-10 Thread Bruce Momjian
Pavel Stehule wrote: OK, how do we even explain this idea in the FAQ. It pulls 20 random values from 1 to 1? That seems pretty hard to code to me. Where do you get the 1 number from? How do you know you will hit a match in 20 tries? Number 1 you have to store in

Re: [HACKERS] some points for FAQ

2007-10-09 Thread Alvaro Herrera
Pavel Stehule escribió: p.s. can we create some general F.A.Q XML format and store FAQ there? WIP Proposal: faq name = . language = entry number=1.1.1 query/query ansver ... we need some tags from html: pbraibullitable There is a DocBook spec for FAQ lists.

Re: [HACKERS] some points for FAQ

2007-10-09 Thread Pavel Stehule
2007/10/9, Alvaro Herrera [EMAIL PROTECTED]: Pavel Stehule escribió: p.s. can we create some general F.A.Q XML format and store FAQ there? WIP Proposal: faq name = . language = entry number=1.1.1 query/query ansver ... we need some tags from html:

Re: [HACKERS] some points for FAQ

2007-10-09 Thread Chris Browne
[EMAIL PROTECTED] (Alvaro Herrera) writes: Pavel Stehule escribió: p.s. can we create some general F.A.Q XML format and store FAQ there? WIP Proposal: faq name = . language = entry number=1.1.1 query/query ansver ... we need some tags from html: pbraibullitable

Re: [HACKERS] some points for FAQ

2007-10-09 Thread Bruce Momjian
Pavel Stehule wrote: 4.1) To SELECT a random row, use: SELECT col FROM tab ORDER BY random() LIMIT 1; + On bigger tables this solution is slow. Please, find smarter solution on network. Well, give me a better example that works. 4.6) ILIKE is slow, specially on

Re: [HACKERS] some points for FAQ

2007-10-09 Thread Pavel Stehule
2007/10/9, Bruce Momjian [EMAIL PROTECTED]: Pavel Stehule wrote: 4.1) To SELECT a random row, use: SELECT col FROM tab ORDER BY random() LIMIT 1; + On bigger tables this solution is slow. Please, find smarter solution on network. Well, give me a better

Re: [HACKERS] some points for FAQ

2007-10-09 Thread Bruce Momjian
Pavel Stehule wrote: 2007/10/9, Bruce Momjian [EMAIL PROTECTED]: Pavel Stehule wrote: 4.1) To SELECT a random row, use: SELECT col FROM tab ORDER BY random() LIMIT 1; + On bigger tables this solution is slow. Please, find smarter solution on

Re: [HACKERS] some points for FAQ

2007-10-09 Thread Pavel Stehule
2007/10/9, Bruce Momjian [EMAIL PROTECTED]: Pavel Stehule wrote: 2007/10/9, Bruce Momjian [EMAIL PROTECTED]: Pavel Stehule wrote: 4.1) To SELECT a random row, use: SELECT col FROM tab ORDER BY random() LIMIT 1; + On bigger tables this

Re: [HACKERS] some points for FAQ

2007-10-09 Thread Bruce Momjian
Pavel Stehule wrote: Better universal solution doesn't exist. Exists only unelegant solutions - but mutch faster. SELECT id, ... FROM data WHERE id = ANY(ARRAY( SELECT (random()*:max_id)::int FROM generate_series(1,20)))

Re: [HACKERS] some points for FAQ

2007-10-09 Thread Pavel Stehule
ok. I accept it. Can be some note there? Not this strange select. Well, with 8.3 having this be faster I am thinking we should wait to see if the hacks are needed. difference, on 10K lines (on small think table) postgres=# select * from test where i = any(array(select

Re: [HACKERS] some points for FAQ

2007-10-09 Thread Bruce Momjian
Pavel Stehule wrote: ok. I accept it. Can be some note there? Not this strange select. Well, with 8.3 having this be faster I am thinking we should wait to see if the hacks are needed. difference, on 10K lines (on small think table) postgres=# select * from test where i =

Re: [HACKERS] some points for FAQ

2007-10-09 Thread Pavel Stehule
OK, how do we even explain this idea in the FAQ. It pulls 20 random values from 1 to 1? That seems pretty hard to code to me. Where do you get the 1 number from? How do you know you will hit a match in 20 tries? Number 1 you have to store in application .. it's magic