Re: [GENERAL] Can this be indexed?

2004-11-07 Thread Jerry III
But if you do build an index over "id" then pgsql would only have to do a sequential scan on that index, which might be a lot faster if your table contains a lot of other data, won't it? Jerry ""Ed L."" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Saturday November 6 2004 7

Re: [GENERAL] simple query question: return latest

2004-11-15 Thread Jerry III
SELECT "date" FROM "table" WHERE "color" = 'red' ORDER BY "date" DESC LIMIT 1; Don't worry about names, just quote your identifiers. They will stand out and you can use anything you want. Jerry "Michael Glaesemann" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Scott, > > On No

Re: [GENERAL] Last value inserted

2004-11-15 Thread Jerry III
Which means that sometimes they do not return the correct value - if you have a trigger that inserts another record you will not get the right value. MSSQL has @@IDENTITY and SCOPE_IDENTITY() to handle this case, I'm new to pgsql so I don't know if it has anything like that. Jerry "Richard Hux

Re: [GENERAL] How to handle larger databases?

2004-11-21 Thread Jerry III
There's some basic database issues you should follow, no matter what your database engine. Index your columns, but with reason, do not index a column that only contains several distinct values (such as yes/no fields). Inde xover several columns if your queries can narrow the resultset using mor