[how to] How can I speed up PgAdmin III Queries? |
- How can I speed up PgAdmin III Queries?
- No predicate warning
- How can I write windowing query which sums a column to create discrete buckets?
- How to profile a particularly slow or inefficient query
- How do I rebuild single full text catalog (or why is "rebuild" full text catalog option disabled)
- TempInsertStateItemShort procedure on ASPState is taking more than 1 second to execute
- How to enter multiple checkbox list items into database for eventual reporting [closed]
- export (mysqldump) databases from MySQL version 4.0?
- Can Someone Decrypt this? [closed]
- Total of select by all current session and by date
- Select data one by one from table and data need to repeat custom number of times [closed]
- How can I send HTTP requests from SQL Server 2012 to a non-.Net application? [duplicate]
- how to do Tungsten replication trouble shooting in mysql? [closed]
- SQL Server Agent Jobs and Availability Groups
- copy only tables with data from one database to another database [closed]
- How to determine that the chain of log degraded
- Full text search on multiple tables in PostgreSQL
- WITH ROLLUP WHERE NULL = x
- why would command text not execute at all?
- Avoiding performance hit from GROUP BY during FULLTEXT search?
- AWS performance of RDS with provisioned IOPS vs EC2
- How to troubleshoot SQL Server Merge Replication Conflict?
- Open source and commercial tools to build dynamic queries of fact tables in star schema
- sp_startpublication_snapshot Parameter(s)
- Passing path from batch file to mysql [closed]
- SQL Server 2012 Standard Edition - multiple instances and memory utilization
- Flashback feature in Oracle 11g?
- PostgreSQL 9.1 Hot Backup Error: the database system is starting up
How can I speed up PgAdmin III Queries? Posted: 24 Jun 2013 01:55 PM PDT I've been noticing that PgAdmin III isn't as responsive as I expected it to be. For instance a query to As such it appears that PgAdmin III takes approximately twice as long to query my database over DbVisualizer. So how can I speed up PgAdmin III Queries? I am using Heroku Postgres 9.1.9 on the Crane package. |
Posted: 24 Jun 2013 02:00 PM PDT I am getting No predicate warning on this query , can some help ? |
How can I write windowing query which sums a column to create discrete buckets? Posted: 24 Jun 2013 05:50 PM PDT I have a table which includes a column of decimal values, such as this: What I need to accomplish is a little difficult to describe, so please bear with me. What I am trying to do is create an aggregate value of the My naive first attempt was to keep a running As you can see, if I were to simply use My initial attempts have involved making multiple passes over the data, once to perform the Which was used in an |
How to profile a particularly slow or inefficient query Posted: 24 Jun 2013 02:57 PM PDT I'm currently writing queries for my database but this is the first time I've dealt with large data sets of any sort, and I'm now finding that I need to improve the performance of my queries. Scenario I have a series of tables for purchases and customers as described below users (user_id, forename, surname) 20k+ records customers (customer_id, user_id, etc etc) 20k+ records purchases (purchase_id, item_id, customer_id, price, timestamp, store_id) 150k+ records deliveries (purchase_id, delivered_time etc) 150k+ records store (store_id, name etc) <50 records The query I am currently trying to perform should retrieve all customer names, the date of their last order, when that order was delivered and their total number of orders for all customers at a particular store whos most recent order was in the last 6 months. Here is what I'm currently using. However, this is pretty slow and takes 1-2 seconds each time, and I can only assume this time would increase as the amount of data increases. In an attempt to profile the query I have used EXPLAIN which seems to indicate it is searching through around 20k records in the deliveries table. What should my next steps be to optimize this query? How can I go about reducing the execution time? |
How do I rebuild single full text catalog (or why is "rebuild" full text catalog option disabled) Posted: 24 Jun 2013 11:50 AM PDT In SSMS. I have Full Text Catalog defined. If I select "Full Text Catalogs" folder - there is an option "Rebuild All" and it is enabled. But if I select individual FTC - "Rebuild" option (in context menu) is disabled. Question Why is it disabled? and how do I enable it? |
TempInsertStateItemShort procedure on ASPState is taking more than 1 second to execute Posted: 24 Jun 2013 09:31 AM PDT I'm working on a .NET website who runs in load balance within more than one server and because of that I need to have my session on SQL Server. In the last 2 weeks I've notice that the procedure TempInsertStateItemShort is taking more than 1 second to run. Basically this procedure inserts into tempdb.dbo.ASPStateTempSessions tempdb.dbo.ASPStateTempSessions table has 800k rows and the PK index is about 98% fragmented. Does the fragmentation be the reason for insert take more than 1 second? Does anyone had experience that? How can I improve performance on this table? Thanks in advance!!!! |
How to enter multiple checkbox list items into database for eventual reporting [closed] Posted: 24 Jun 2013 12:03 PM PDT (I tried posting this on SO but went unansered. I'll just post these theory type questions here from now on) I'm in the process of creating the first of a few CheckBoxList for a manually created form submittal. I've been looking over multiple ways to not only create said CheckBoxList but to enter it into the database. However, the challenge I'm facing (mainly because I haven't encountered this scenario before and I'd like to learn this) is that I not only need to worry about entering the items correctly in the database but I will eventually need to produce a report or make a printable form from these entries. Let's say I have an order form for a specific type of Barbeque grill and I will need to send this form out to distriution centers across the nation. The distribution centers will need to pull said barbecues if they are highlighted on the form. Here's what the CheckBoxList for the distibution centers will look like: All Dallas Miami Los Angeles Seattle New York Chicago Phoenix Montreal If the specific city (or all the cities) are checked, then the distribution center will pull the barbecue grill for shipment. The added part is that I want to:
What I'm looking for is a theoretical approach to designing this form while keeping in mind the gridview and reports. Do I put the CheckBoxList data in one cell in a specific column? Do I create seprate columns for each distribution center? Am I even on the right track here? Note: At this point I'm not looking for coding help, I'm just looking for some theory/logic help so I can learn this the right way the first time. ::edit:: First off, please note that the database design I have now is fully in sandbox mode. Nothing is finalized. Everything (again this is in sandbox mode) is in one single table. Also, I'm in now way looking for coding help. I'm looking for the right theoretical/logical approach to this puzzle so I can go in and play with the coding myself. I learn better that way. If I need coding help, I'll come back here for further assistance. Here's what I'm working with right now. In my aspx page I have a checkboxlist programmed with all the distribution centers entered as a listitem as well as an option for 'ALL' (of the distribution centers). I also created a dedicated column in this table that holds all the information in the listitem and programmed a sqldataconnection to this table to play with the programmability of leveraging the database for this purpose. When it comes to writing the selections to the database, I originally created a column for each destination city including the 'All' option. I was toying around with just putting the selections into one single column but with some of the information I've been reading today about Database Normalization, the former options seems to be a better one than the latter. Is this correct practice for situations such as this especially if I need to think about reporting? |
export (mysqldump) databases from MySQL version 4.0? Posted: 24 Jun 2013 09:27 AM PDT Goal: export the schema and data from a MySQL version 4.0.16 DB. Background: I was asked to migrate a database from MySQL version 4.0.16. The database was installed on a Windows XP machine, and I just could not find mysqldump tool on that machine. I then putty into a linux machine that has mysqldump. I ran the command, but got an error: I looked up mysql reference. INFORMATION_SCHEMA is something new to version 5 and above. This means the mysqldump on the linux box is incompatible with the production MySQL server which is on v4.0.16. I tried to download Mysql 4.0 server and install it on a windows machine so that I can get hold of a compatible version, but searching on Mysql website found nothing older than 5.0. (I also tried Mysql workbench to connect to this DB. Failed. "Unknown character set utf8") So how can I export the schema and data at all from this legacy mysql DB???... |
Can Someone Decrypt this? [closed] Posted: 24 Jun 2013 09:11 AM PDT It's from config.py file. Thank you very much. Also, explain how did you get the db_password? |
Total of select by all current session and by date Posted: 24 Jun 2013 08:07 AM PDT In MySQL : This query allows us to have the total number of "select" on the server (query 1) : and this query allows us to know the number of "select" for the current session : or please, how to have the number of "select" for all current sessions (total) and a query like the first (query 1) , but by date. Thanks. |
Select data one by one from table and data need to repeat custom number of times [closed] Posted: 24 Jun 2013 09:00 AM PDT I have table data like and I need to select these rows like this: and how to perform this in SQL Server 2005? |
How can I send HTTP requests from SQL Server 2012 to a non-.Net application? [duplicate] Posted: 24 Jun 2013 08:33 AM PDT This question is an exact duplicate of: I know basic only concepts (DDL,DML queries) of the SQL Server 2012. I explain the workflows of both my application and the database below. Workflow of the application: I build web application in Java. Whenever it receives an HTTP request, it fetches data from the database, does some computations on the data and the computed data will be stored in another database. Before explaining the database workflow, I will explain what a database modification is from my point of view: If any operation happens like creating new tables, data modification, data deletion in tables, etc. indirectly all these are effects on the database. Workflow of the database: I have SQL Server 2012. Whenever the database is modified, it will send an HTTP request to the application. The Application runs on an Apache Tomcat server. Once the application receives the HTTP request, it continues that individual workflow. If you understand my question, we are not sending HTTP requests from a browser (i.e. end-users can't access this application), we are sending HTTP request from SQL Server. I hope you understand what my question is. I read some tutorials for this, but I didn't get anything. Can anyone suggest the correct way of doing this? |
how to do Tungsten replication trouble shooting in mysql? [closed] Posted: 24 Jun 2013 11:18 AM PDT we have done replication setup(master to slave) using tungsten replicator in mysql.we have done setup successfully.But i don't know the trouble shooting about replication issues. i want to learn about tungsten replication trouble shooting(regarding replication issues). How can i learn.Anybody Could you please suggest me. i was goggled so much but i didn't find any proper guides. Please help me. |
SQL Server Agent Jobs and Availability Groups Posted: 24 Jun 2013 11:42 AM PDT I'm looking for best practice in dealing with scheduled SQL Server Agent jobs in SQL Server 2012 availability groups. Maybe I missed something, however at the current state I feel that SQL Server Agent is not really integrated with this great SQL2012 feature. How can I make a scheduled SQL agent job aware of a node switch? For example I have a job running on the primary node which loads data each hour. Now if the primary goes down, how can I activate the job on the secondary which now becomes primary? If I schedule the job always on the secondary it fails because then the secondary is read-only. |
copy only tables with data from one database to another database [closed] Posted: 24 Jun 2013 09:43 AM PDT I have two database , |
How to determine that the chain of log degraded Posted: 24 Jun 2013 09:03 AM PDT SQL Server 2005. I have DB with full recovery model. If i execute on my base or then if I try run log backup I receive error message
Question: |
Full text search on multiple tables in PostgreSQL Posted: 24 Jun 2013 12:52 PM PDT I have several tables that have related data. I want to have a search input box on the dashboard of the system that will search for anything (client, invoice, delivery note, ...). Is it possible to have a FTS implementation in PostgreSQL that will get the item searched for in more than one table and get the results? For example, if the user typed 45, the query should look in the clients table and return the clients with id 45 or name has 45, also look in the invoices table and return the invoices with number 45, and also look into the delivery notes table and return the delivery notes with number 45. Or is there a better way of solving this problem without using full text search? |
Posted: 24 Jun 2013 12:37 PM PDT I tried to find this question somewhere else on here, and found a couple that were similar to it -- but all the answers seemed pretty convoluted, and I think it was surprising to me because I just imagined that SQL would have a way easier way to do this. Essentially, I'm using a Is there an easy way to substitute something saying if "NULL" is in the "Person" column, then make And if that's weirdly complicated, I'd be totally fine with just calling all of them "Total." Thanks! |
why would command text not execute at all? Posted: 24 Jun 2013 05:37 PM PDT in my report i have:: i am using sql server profiler to see exactly what statement is being set. i have set only two filters:
yet after running the report, no statement gets intercepted. i suspect that because i am a beginner at SSRS, i am missing something crucial here. for what reason would commandtext not be executed at all? i did follow this question, to make sure that i am using sql profiler correctly, and indeed, i am: http://stackoverflow.com/questions/9107383/sql-server-profiler-capture-calls-to-your-databases-stored-procs-during-ssrs another bit of important information is although the chart shows no data: i actually am indeed showing data when i run the commandtext from ssms! |
Avoiding performance hit from GROUP BY during FULLTEXT search? Posted: 24 Jun 2013 09:37 AM PDT Is there any clever way to avoid the performance hit from using group by during fulltext search? In this example it's fetching the lowest post_id for unique topic_ids that match the text. With the group by to find the min, it's taking 600ms in a million row database, with about 50K rows examined. If I remove the MIN but leave the GROUP BY, it's the same slowness, so it's the GROUP hit. I suspect this is because it can only use one index, the fulltext ? Without the GROUP BY it's 1ms so this has to be filesort speed? (I've removed ORDER BY and everything else to isolate where the hit is) Thanks for any insight and ideas. (using MyISAM under mariadb if it matters) |
AWS performance of RDS with provisioned IOPS vs EC2 Posted: 24 Jun 2013 11:37 AM PDT Has anyone done a performance comparison of AWS RDS with the new provisioned IOPS vs EC2? I've found plenty of non-high IOPS RDS vs EC2 but nothing with the new high IOPS feature in RDS. |
How to troubleshoot SQL Server Merge Replication Conflict? Posted: 24 Jun 2013 08:38 AM PDT I have SQL Server 2008 R2 Merge Replication setup. I have 2 publications for the same database with 20+ subscribers. The logic of our application prevents changing the same data from 2 subscribers at the same time. Lately I started getting conflicts for some specific tables & almost all the time the contents of the 2 conflicting rows ( the publication row & the subscriber row ) are identical with no differences at all!! My question is: What is the standard steps to troubleshoot conflicts & trace down to the point that is causing it? |
Open source and commercial tools to build dynamic queries of fact tables in star schema Posted: 24 Jun 2013 03:08 PM PDT What user interfaces or tools (commercial and/or open source) can query a star schema model (Ralph Kimball dimensional model)? So for example, if we have X fact tables, and Y dimension tables, and Z cross reference tables, we'd like to query a random fact table. If you are aware of such tools, can you provide a reference of each. |
sp_startpublication_snapshot Parameter(s) Posted: 24 Jun 2013 06:37 PM PDT I am creating a stored procedure that:
Here is my new brick wall... On this DB server, I have a 'shell' db that they will be running the SP from, that has a history table so I can keep track of who created/deleted databases using my SP's... The only parameter for sp_startpublication_snapshot is @publication... I can give it the publication name, but since I am not running it from the publishing database, how do I specify the publishing database? i.e.: the publication shows up as: but I am running the script from the database [WC_QACatalog] Any ideas about how to accomplish this? Thank you, Wes |
Passing path from batch file to mysql [closed] Posted: 24 Jun 2013 08:36 AM PDT My batch file will contain some thing like this : Content of DBQuery1.sql will be : I am not sure this is the way to pass path to the SELECT query inside DBQuery1.sql. This code is not working. I looked at other posts on passing path to batch file, but whatever I tried, I am not able to solve this issue. When I execute the batch file, I am not sure if the path is getting passed into the sql file and if yes, why @2 is not getting the path passed. Could anybody kindly help on this. |
SQL Server 2012 Standard Edition - multiple instances and memory utilization Posted: 24 Jun 2013 09:43 AM PDT If we have multiple instances of a SQL Server 2012 Standard Edition (which has a 64 GB memory limit) on one server which has 192 GBs of RAM, do both instances only have access to the first 64 GBs of memory, or can they access different portions of memory, so that they can each have their own 64 GB "chunk". This is in consideration for an Active/Active cluster if both nodes fail over to a single node. |
Flashback feature in Oracle 11g? Posted: 24 Jun 2013 11:17 AM PDT I am using Oracle 11gR1. As a part of a project, I have to execute multiple update statements by disabling a few constraints (triggers and check constraints) which could result in a corrupted database. If the database gets corrupted, I have to re-import it entirely, which is an additional task that is time consuming. I have very little knowledge about the Oracle Flashback feature. Will Flashback help me to avoid these unnecessary imports? Can I set some stable point and switch back to there if anything goes wrong? Can someone please give me brief overview on this feature? If it fits my requirements, I will try to learn. |
PostgreSQL 9.1 Hot Backup Error: the database system is starting up Posted: 24 Jun 2013 08:24 PM PDT I have been working on a hot backup for Postgres 9.1 for awhile and have run into a consistent issue. After restarting Postgres on the slave server the pgstartup log file and the daily log file under the pg_log directory reads with no errors. However, when I try to enter into the database using the psql command, I get the error: FATAL: the database system is starting up. The recovery.conf file also does not turn to recovery.done. I have extensively researched this error and consistently find the same response: the database has not been cleanly shut down before I tried to restart Postgres. The only ways I have restarted Postgres is through the Master Server Configurations: pg_hba.conf, added the line: host replication postgres IPAddressOfSlaveServer trust postgresql.conf: wal_level = hot_standby max_wal_senders = 5 listen_address = '*' port = 5432 max_wal_senders = 5 wal_keep_segments = 32 Slave Server Configurations: postgresql.conf: hot_standby = on recovery.conf: standby_mode = on primary_conninfo = host=IPAddressOfMasterServer port = 5432 user = postgres restore_command = 'cp /var/lib/pgsql/9.1/data/pg_xlog/%f "%p"' After configuring both servers I change to the postgres user on the master server and run the commands: psql -c "Select pg_start_backup('label',true);"; rsync -a -v -e ssh /var/lib/pgsql/9.1/data slave:/var/lib/pgsql/9.1/data \ --exclude postmaster.pid pgsql -c "select pg_stop_backup();"; After syncing database with slave server I restart the slave server and the start up does not fail. The pgstartup.log reads: Success. You can now start the database server using: /usr/pgsql-9.1/bin/postgres -D /var/lib/pgsql/9.1/data or /usr/pgsql/9.1/bin/pg_ctl -D /var/lib/pgsql/9.1/data -l logfile start the current day log file, postgresql-Thu.log, reads: Log: shutting down Log: Database system is shut down Log: database system was shut down in recovery at 2012-4-10 Log: entering standby mode Log: restored log file "logFileName" from archive Log: consistent recovery state reached at 0/BF0000B0 Log: redo starts at 0/BF000020 Log: restored log file "logFileName" from archive Log: unexpected pageaddr 0/85000000 in log file 0, segment 192, offset 0 Log: unexpected pageaddr 0/85000000 in log file 0, segment 192, offset 0 Log: streaming replication successfully connected to primary I researched unexpected pageaddr and from the postgres archives, it is my understanding that it is quite normal and one of the expected ways to detect end-of-WAL. Any advice would be greatly appreciated. |
You are subscribed to email updates from Recent Questions - Database Administrators Stack Exchange To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google Inc., 20 West Kinzie, Chicago IL USA 60610 |
No comments:
Post a Comment