Skip to main content
David Aldridge's user avatar
David Aldridge's user avatar
David Aldridge's user avatar
David Aldridge
  • Member for 11 years, 9 months
  • Last seen more than a month ago
  • Haddenham, United Kingdom
comment
Understanding Function Index
If Y was a constant, then it could be specified in the index definition. It cannot be read from a different table.
comment
Large batch INSERTs / UPDATEs and DELETEs Performance problem
Have you looked into partitioning (is that what you mean by "child tables")? This would physically cluster the rows by category, and the vacuum would probably be more efficient because it would target only the tables that have changed. Multiple updates of different categories would be deconflicted also. I can't really comment further as I have no hands on experience of pg partitioning, but if it were Oracle then this would be almost a text book case.
comment
Large batch INSERTs / UPDATEs and DELETEs Performance problem
Is there a pattern to the batches? For example, that each one is entirely for a particular "category" (which you mention in the question). If so, how many categories are there in total, and how many rows per category?
answered
Loading…
comment
Creating a summary table for an averaging query
Maybe not a direct answer, but instead of storing AVG, consider storing both SUM(score) and COUNT(*), giving you total_score and score_count. Those are then aggregatable and an average can then be calculated from them with sum(total_score) / sum(score_count), so you have a more flexible solution that can provide averages at different granularities.
answered
Loading…
awarded
awarded
comment
Should one always VACUUM ANALYZE before REINDEXing in PostgreSQL 8.4?
Are you deleting or truncating? And have you set a fillfactor of 100 on those indexes?
comment
Do relational databases typically understand '1' and '0' as booleans?
No Booleans in Oracle SQL, although PL/SQL supports it.
comment
Why use explicit cursors instead of regular loops?
It's worth mentioning that both forms of cursor have inferior performance to a pure SQL solution -- particularly relevant to DML statements.
comment
Why use explicit cursors instead of regular loops?
Implicit cursors fetch 100 rows at a time from 10g onwards.
Loading…
awarded
Loading…
awarded
awarded
awarded
awarded
comment
How to rollback last executed sql script fired as sysdba
Be very sure that the objects that you are planning on deleting were actually created by the script. If you tried to created a table called SEQ$ then it would have failed, because one already exists under the SYS schema. You would definitely not want to drop it. Check using the DBA_OBJECTS view, and look at the CREATED column to check. On a cheery note, I've worked at some places where a mistake like this would have got you fired.
1 2
3
4 5
10