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

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 co

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 *

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 (rando

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

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;

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, fin

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. > > > >

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,

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: >> >> >> >> >> >> ... >> we need some tags from html: > > There is a DocBook spec for FAQ lists. Actually a friend

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: > > > > > > > > > > > > ... > > we need some tags from html: > > There is a DocBook spec for FAQ lists. Actua

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: > > > > > > ... > we need some tags from html: There is a DocBook spec for FAQ lists. Actually a friend of mine was working on converting our FAQ into that kind o

[HACKERS] some points for FAQ

2007-10-09 Thread Pavel Stehule
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. 4.6) ILIKE is slow, specially on multibyte encodings. If is possible use FULLTEXT. LIKE '%some%' is slow always