Re: [GENERAL] Using indices with long unique IDs.

2004-01-09 Thread Greg Stark
"Sergey Olefir" <[EMAIL PROTECTED]> writes: > Unfortunately neither of them seem to be portable (for example, the one with > single quotes fails if I create PreparedStatement in Java: > con.prepareStatement("SELECT * FROM table WHERE id='?'"); apparently Java > doesn't parse question mark inside q

Re: [GENERAL] Using indices with long unique IDs.

2004-01-09 Thread Alvaro Herrera
On Fri, Jan 09, 2004 at 04:11:08AM -0600, D. Dante Lorenso wrote: > Sergey Olefir wrote: > > >So the logical choice would be int8, right? Unfortunately quite wrong. > >Statement of the form: "SELECT * FROM table WHERE id=1" > >will never use index for id (assumming id is int8) since '1' is of type

Re: [GENERAL] Using indices with long unique IDs.

2004-01-09 Thread D. Dante Lorenso
Sergey Olefir wrote: So the logical choice would be int8, right? Unfortunately quite wrong. Statement of the form: "SELECT * FROM table WHERE id=1" will never use index for id (assumming id is int8) since '1' is of type int4. This is confirmed both by documentation and SQL EXPLAIN (after set enabl

[GENERAL] Using indices with long unique IDs.

2004-01-09 Thread Sergey Olefir
Hello! I am planning to use unique IDs in the little system I am building. Now being more than a little paranoid (and having no idea about expected loads), I am wary of using int4 as a basis for uids (for the fear of ever running out of them). So the logical choice would be int8, right? Unfortun