Re: [SQL] What does PostgreSQL do when time goes backward?

2010-08-04 Thread Steve Wampler
something wrong there. I saw very bad clock performance on one Linux box I had (dual-single core AMD cpus, no VMs), even with NTP, until I changed the clocksource kernel parameter to hpet. Unfortunately (or fortunately) I no longer have that box. -- Steve Wampler -- swamp...@noao.edu The gods that

Re: [SQL] Make COUNT(*) Faster?

2005-07-08 Thread Steve Wampler
Creating a "fast but WRONG COUNT(*)" which prevented getting the exact > answer that the present implementation provides would be a severe > misfeature. Agreed - note that I did not suggest replacing the current COUNT(*) with an inexact version, but wanted (and now have) a quick way t

Re: [SQL] Make COUNT(*) Faster?

2005-07-08 Thread Steve Wampler
Tom Lane wrote: > Steve Wampler <[EMAIL PROTECTED]> writes: > >>So, leave COUNT(*) alone. But it would be very handy to have a >>way to get an approximate table size that is more accurate than is >>provided by a pg_class.reltuples that is only updated on vacuums. &g

Re: [SQL] Make COUNT(*) Faster?

2005-07-08 Thread Steve Wampler
tion of the table size or not (though it might in a table of 100 'true' rows - but the decision to ask for a true 'transaction' count (slow) or an approximate table size (fast) should be left to the user in either case). So, leave COUNT(*) alone. But it would be very handy

Re: [SQL] Make COUNT(*) Faster?

2005-07-08 Thread Steve Wampler
ECT COUNT(*) and far faster to get to.) I assume this has been beaten well past death, but I don't see why it wouldn't be possible to keep pg_class.reltuples a bit more up-to-date instead of updating it only on vacuums. -- Steve Wampler -- [EMAIL PROTECTED] The gods that smiled on

[SQL] Copying rows between tables?

2004-01-13 Thread Steve Wampler
records are archived into 'archive' tables. Occasionally there is a need to copy some of these old records into the 'active' table. Thanks for any pointers! Steve -- Steve Wampler -- [EMAIL PROTECTED] The gods that smiled on your birth are now laughing out loud. ---

Re: [SQL] Replacing a simple nested query?

2003-07-14 Thread Steve Wampler
On Sun, 2003-07-13 at 14:50, Steve Wampler wrote: > I've got a simple nested query: > > select * from attributes where id in (select id from > attributes where (name='obsid') and (value='oid00066')); > > that performs abysmally. I've

[SQL] Replacing a simple nested query?

2003-07-13 Thread Steve Wampler
ter way to obtain the same results? The inner select identifies a set of ids (2049 of them, to be exact) that are then used to locate records that have the same id (about 30-40K of those, including the aforementioned 2049). Thanks! -Steve -- Steve Wampler -- [EMAIL PROTECTED] Quantum mate

Re: [SQL] Using a postgres table to maintain unique id?

2000-11-14 Thread Steve Wampler
int4 *might* work, it doesn't handle the "worst-case" scenario (which is up around 15 billion values). Thanks to everyone for your comments and suggestions! -- Steve Wampler- SOLIS Project, National Solar Observatory [EMAIL PROTECTED]

Re: [SQL] Using a postgres table to maintain unique id?

2000-11-13 Thread Steve Wampler
avoid having to VACUUM ANALYZE this table, though, and it "feels" as though it is duplicating functionality already provided by postgres DB backends. I'll think about this solution - thanks! -- Steve Wampler- SOLIS Project, National Solar Observatory [EMAIL PROTECTED]

Re: [SQL] Using a postgres table to maintain unique id?

2000-11-13 Thread Steve Wampler
lifetime of the project. The table would have a single row with a single column. Selecting that table cell would return the current value, but leave the value incremented in the table cell (it's ok if it increments the value before returning). -- Steve Wampler- SOLIS Project, National Solar Observatory [EMAIL PROTECTED]

[SQL] Using a postgres table to maintain unique id?

2000-11-13 Thread Steve Wampler
with "old" rows for this entry, and this avoid the need to run VACUUM ANALYZE periodically? Any tips on how to implement the trigger would be appreciated. (Is it possible to generate an int8 sequence value?) Thanks! -- Steve Wampler- SOLIS Project, National Solar Observatory [EMAIL PROTECTED]

[SQL] Question on string value expression wildcarding

2000-08-24 Thread Steve Wampler
ion can be used to match only strings prefixed with "kp.dhs."? Thanks! -- Steve Wampler- SOLIS Project, National Solar Observatory [EMAIL PROTECTED]

[SQL] Insert with replace?

2000-05-30 Thread Steve Wampler
here a way to do the same with a single command? (The data is such that the update will fail in the majority of cases.) Thanks! -- Steve Wampler- SOLIS Project, National Solar Observatory [EMAIL PROTECTED]