Reputation
8,257
Top tag
Next privilege 10,000 Rep.
Access moderator tools
Badges
3 18 43
Newest
 Informed
Impact
~402k people reached

Jun
16
comment Adding NotNull FK field in existing DB
What is NN? NOT NULL?
Jun
15
comment Backup SQL server DB
You could start by reading some documents about it - there must be hundreds of them out there.
Jun
15
comment Calculating percentage of count and adding it to the count in MySQL table with the query
5.0 is already ten years old - did you ever think about upgrading to something current?
Jun
15
comment Problems during installation with Database Engine Service
From this listing, it looks like it is only the Express and Developer editions that can be installed there (which matches the requirements above, of course - I just wanted to clarify this a bit.)
Jun
15
comment compound index not being used on simple query
Sorry, above I meant charity_id = 447 AND provider_id = 1, of course.
Jun
14
comment Mysql - unknown variable 'table_cache=64'
I remember an odd problem on some old version of OS X, when configuring postfix from the GUI resulted in some garbled routing rule. Editing the file in an editor worked as expected.
Jun
14
comment compound index not being used on simple query
So, the original plan shows a very slow query for charity_id = 447 AND provider_id = 2, where you count about the half of your whole table. It's still very slow for that many rows, but there is no wonder it does not use the index. With the last two queries you don't show a query plan, one can only guess without them.
Jun
11
comment Getting error: The conversion of a varchar data type to a datetime data type resulted in an out-of-range value
Please clean up your example - it contains a zillion of non-time-related columns which obviously cannot be the source of your problem. All those columns just add noise, making it harder to find the real problem.
Jun
10
comment RDS Postgres Peformance
How do you measure the time? It can be the network speed/latency between the different data centres, too.
Jun
10
comment Combining data from 3 tables depending values stored in 1 table
It's definitely confusing. Try to come up with some sample data and the desired output, preferably in a form that helps reproducing it (CREATE TABLE and INSERT statements for the sample data). Also, check the formatting tools of the post editor.
Jun
9
comment How to check/know the highest run queries
You can also set log_statement to all;. This will produce a nice big log file, but you won't miss any of your queries.
Jun
9
comment How to check/know the highest run queries
Out of curiosity, how big is big? Also, by 'highest run' do you mean the most often run or the cumulatively most expensive queries? And, with a simple view, you don't spare anything in this regard.
Jun
6
comment How to prevent a PostgreSQL trigger from being fired by another trigger?
It sounds like an error in the trigger logic. Could you show the trigger procedure that throws it?
Jun
5
comment Sync offline database with online
Check Londiste. If the different local changes affect distinct sets of rows, then it is relatively easy.
Jun
4
comment What is the best way to clear couple of tables each night at specific hour in Postgres SQL?
If you want to empty the tables, you may want to use TRUNCATE instead.
Jun
4
comment Foreign table not using index
I think that is a different issue. But how often do you need to create this foreign table? Isn't it a one-time operation?
Jun
4
comment Foreign table not using index
You can edit your question with those. Anyway, there is only a half millisecond difference between the two - is there a reason (say, a huge dataset in the future) why you are worried about it?
Jun
4
comment Foreign table not using index
Here you see a foreign scan - I think it does not tell you if it uses an index or not. I would expect it does and you lose the time on network latency or elsewhere. Please add the output of EXPLAIN ANALYZE for both queries.
Jun
4
comment Ensure order when select two rows using two identifiers on the same column
Why do you need this? Anyway, at least in PostgreSQL, SELECT * FROM teams WHERE name = $1 UNION ALL SELECT * FROM teams WHERE name = $2; would return the rows in this order, I believe.
Jun
4
comment Postgresql :i want tro truncate column
Do you want to change the column type, or just get back the shortened text in a query?