[how to] Extracting Multiple Values from Single Field |
- Extracting Multiple Values from Single Field
- MySQL: parallel restores at same time from backup files?
- Relating ExecutionInstanceGUID to the SSISDB
- limitations of key-values store on top of mysql table [closed]
- MySQL - ERROR 1045 (28000): Access denied for user
- h2 Java server synchronization and caching
- Which database could handle storage of billions/trillions of records?
- For a InnoDB only DB, which of these elements can be removed?
- Missing data after attaching .mdf file
- How did this MV refresh automatically, when it is defined to refresh only "ON DEMAND"?
- What is the relationship between keys, indices, primary keys and clustered keys in RDBMS?
- Advise On SQL Server Data Replication
- How does ORDER BY really work? [duplicate]
- Drupal 7 Uses InnoDB, so do I need other configs?
- MySQL Federated acces to PostgreSQL table
- Inheritance and its alternatives in PostgreSQL
- Maintenance in MYSQL when innodb_file_per_table disabled
- slow queries - set weight to token type in tsquery - postgresql
- how to import mysql system "mysql" database
- SUPER privilege not defined for master user in Amazon MySQL RDS
- MySQL optimization
- How to import table's data in MySql from Sql Server?
- Is it possible to pipe the result of a mysqldump straight to rsync as the source argument?
- Need help with long running query
- MySQL Workbench sync keeps requesting the same changes
- mysql performance / cache configuration enigma
- Copy Postgres databases with indexes between instances
- Getting max values from MySQL tables
- Minimizing Indexed Reads with Complex Criteria
- Tools to migrate from SQLite to PostgreSQL
Extracting Multiple Values from Single Field Posted: 28 Mar 2013 05:39 PM PDT I'm an SQL beginner and I'm having trouble searching correctly for the answer to this question, although I'm sure that it's been asked before. I have an column in an SQL table that looks like this: custom_fields (this is the column name) Is there any way to reach inside of this field with an SQL statement to get the values individually? I'd like to make three lists of the individual values to export to CSV files in a vertical columns. Basically, the result should be a column like (for each value): age_range I've been trying: SELECT custom_fields.age_range FROM arp3_cam WHERE 1 But this is obviously incorrect. I'd really appreciate any hints on how to filter for values inside the same field -- feel free to redirect me to an answer if this has already been asked somewhere else. Thanks! EDIT: based on other posts I've been reading, this setup violates first normal form, however, I still need to extract the data, if possible. I definitely wish the values in "custom_fields" had been added as individual columns. |
MySQL: parallel restores at same time from backup files? Posted: 28 Mar 2013 08:54 PM PDT Slightly related to this question, but for MySQL: Would it be possible/wise to execute 2 parallel restores from a single backup? Is it possible/wise to do a parallel restore of two independent databases from two separate MySQL dump files? Restoring one of them seems to only take up about 10% of CPU cycles consistently and takes a long time to finish, so I'm thinking that a second restore shouldn't cause any load problems - but might it cause any other MySQL/DB issues? |
Relating ExecutionInstanceGUID to the SSISDB Posted: 28 Mar 2013 04:06 PM PDT The 2012 release of SQL Server Integration Services, SSIS, has delivered an SSISDB catalog which tracks the operations of packages (among other things). The default package execution for solutions using the Project Deployment model will have logging to the SSISDB turned on. When a package executes, the What I'd like to know, is how do I tie an ExecutionInstanceGUID to anything in the SSISDB catalog. Alternatively, is an SSIS package executing in the SSISDB privy to the value of its Ultimately, I am trying to use the existing, custom audit table and link it back to the detailed history in the SSISDB catalog but can't seem to find the link. |
limitations of key-values store on top of mysql table [closed] Posted: 28 Mar 2013 02:20 PM PDT Consider some implementation of key-value store on top of one mysql table with only two field "key" and "value". Would this be a "good" key-values store, or creating it on top of mysql would have some limitations? |
MySQL - ERROR 1045 (28000): Access denied for user Posted: 28 Mar 2013 06:37 PM PDT I just installed a fresh copy of Ubuntu 10.04.2 LTS on a new machine. I logged into MySQL as root: I created a new user called repl. I left host blank, so the new user can may have access from any location. I checked the user table to verify the new user repl was properly created. I then exit, try to login as user repl, but access is denied. Why is access denied? |
h2 Java server synchronization and caching Posted: 28 Mar 2013 10:26 AM PDT I'm happily coding a client-server application in Java using H2 as database. The server runs the database as an embedded local database while clients connect to it via TCP. Now more and more I see myself in need of syncing between clients and server which requires complex messaging and threads keeping track of the last change to the database. Caching is also a good thing I might need because right now each client requests the same table every time an update has been made. Now my question is: isn't there something for syncing and caching with Java and H2 which is quick and easy library not an entire stack of database layer like hibernate or Mongrel? I feel like reinventing the wheel for something not extremely complex to do. |
Which database could handle storage of billions/trillions of records? Posted: 28 Mar 2013 03:36 PM PDT We are looking at developing a tool to capture and analyze netflow data, of which we gather tremendous amounts of. Each day we capture about ~1.4 billion flow records which would look like this in json format: We would like to be able to do fast searches (less than 10 seconds) on the data set, most likely over narrow slices of time (10 - 30 mintes intervals). We also want to index the majority of the data points so we can do searches on each of them quickly. We would also like to have an up to date view of the data when searches are executed. It would be great to stay in the open source world, but we are not opposed to looking at proprietary solutions for this project. The idea is to keep approximately one month of data, which would be ~43.2 billion records. A rough estimate that each record would contain about 480 bytes of data, would equate to ~18.7 terabytes of data in a month, and maybe three times that with indexes. Eventually we would like to grow the capacity of this system to store trillions of records. We have (very basically) evaluated couchbase, cassandra, and mongodb so far as possible candidates for this project, however each proposes their own challenges. With couchbase the indexing is done at intervals and not during insertion of the data so the views are not up to date, cassandra's secondary indexes are not very efficient at returning results as they typically require scanning the entire cluster for results, and mongodb looks promising but appears to be far more difficult to scale as it is master/slave/sharded. Some other candidates we plan to evaluate are elasticsearch, mysql (not sure if this is even applicable), and a few column oriented relational databases. Any suggestions or real world experience would be appreciated. |
For a InnoDB only DB, which of these elements can be removed? Posted: 28 Mar 2013 10:46 AM PDT So, I'm trying to set up a Drupal 7 my.conf file that's combining best practices from various performance blogs. I'm realizing though that some of them are older than others, and many aren't assuming InnoDB. So of this list of configs, which are irrelevant if you're building for InnoDB. |
Missing data after attaching .mdf file Posted: 28 Mar 2013 12:42 PM PDT Recently, one of my customers had a server crash. Unfortunately, the 3th party who was responsible for the backup was 'forgotten' to schedule a backup of the DB (I know, I should have notice that). After a professional recovery, I have the However, the most recent changes (say from one month before crash) are missing. Has anyone seen that before? Does anyone knows a solution for that? Is it possible that it is still in the As a side note, I'm sure that the data was there since there is a printed version. I'm also sure that it is the most recent I did already several So, please help me with the missing data. Thanks in advance! |
How did this MV refresh automatically, when it is defined to refresh only "ON DEMAND"? Posted: 28 Mar 2013 04:03 PM PDT This seems a bit odd but I can't put my finger on the issue.. As this happened on the Production database, I am confident that no DB user has initiated the refresh from their side. Is there some know bug or other factors that could have caused the refresh? I defined an MV (materialized view) that is refreshed The Source of ON_DEMAND_MV is as follows: Recently I noticed that the MV had refreshed automatically in between of our on-demand refreshes that are triggered by Informatica Sessions (an ETL tool) - I confirmed the same by looking at the Is there anything I could do to further debug this issue..? Thank you. |
What is the relationship between keys, indices, primary keys and clustered keys in RDBMS? Posted: 28 Mar 2013 06:13 PM PDT I am pretty confused about these terms in RDBMS: Keys, and indices: Are they the same concept? For example: In this table, which is a key? Which can be called an index? Is there 'non-primary key' in this table? And how does they improve the efficiency of searching? Thanks. |
Advise On SQL Server Data Replication Posted: 28 Mar 2013 10:49 AM PDT We have a huge enterprise system, with geographically seperated SQL servers. We have some requirements related with data replication between these servers. We have considered the Sync Framework option, but there is a requirement regarding multiple parallel data replication. Thus, Sync framework does not seem to be an option. Also, we do not have a central database; requirements state that user shall configure the topology and related conflict resolution steps. There are three conflict resolution options; "source wins", "destionation wins" and "timestamp based". Also, note that, database structure is a bit complicated and we have some deep hierarchies. Lastly, the only way of communication between these servers is using port 80; using other ports is not an option. I need to decide how to implement the replication structure, but I do not seem to have any options other than creating a replication structure manually and implementing all features. Do you know any tools, or have any ideas how to handle replication easily without any central SQL server and with user configurable topologies? |
How does ORDER BY really work? [duplicate] Posted: 28 Mar 2013 11:03 AM PDT This question already has an answer here: I have one question that confusing me. By logical query processing, the In case your query has a |
Drupal 7 Uses InnoDB, so do I need other configs? Posted: 28 Mar 2013 10:47 AM PDT If I'm optimizing a database that will be delivering multiple Drupal 7 websites, all using InnoDB, do I need to worry about I'm assuming if I delete these sections, that the defaults will just kick in if they are needed. I'm trying to document, outline my.conf best practices here http://groups.drupal.org/node/289613 |
MySQL Federated acces to PostgreSQL table Posted: 28 Mar 2013 04:35 PM PDT For example 2 DBases:
In each DB include one DB and one table in it. Can I work with table in PostgreSQL through MySQL? Is it possible to link as federated postgresql table to mysql database? For make insert/update/select/delete or join operations with such linked table. I can link MySQL to MySQL by code below and make all operations. Can I link postgresql table of anyone postgresql version to someone mysql version? for it using as part of federated DB? |
Inheritance and its alternatives in PostgreSQL Posted: 28 Mar 2013 05:20 PM PDT I make an archaeological database in PostgreSQL 9.2. The description of archaeological context has a subdivision between different types of context. I'm not sure how to implement it: 1) to violate third normal form It is the dirtiest and probably the worst solution. I could check potencial duplicities by triggers, but I suspect it would be the hardest way, for there are quite a lot of type specific columns. 2) inheritance This is better and might be good enough, but my "finds" table should have a foreign key to the "context" table regardles of its type. According to the manual this would cause problems. With all data in tables "layer", "cut", "structure" etc., would the foreign key to "context" table really point to the data stored in the inherited tables? If there's any caveat, is there some (relatively) easy workaround? 3) some sort of 1:1 relation The "finds" table would be connected to "context" table, and tables for various types of context would have a foreign key pointing to the "context" table. But how to assure that exactly one row in all the dependent tables corresponds to each row in "context"? 4) ??? There might be some other solution which I didn't know about. Which of these is easiest to implement (including avoiding duplicity)? And which is best in the terms of performance? I'd be glad for answers telling me which option I should use, why, and especially: how to overcome its drawbacks (or that I missed something and there's no real drawback). |
Maintenance in MYSQL when innodb_file_per_table disabled Posted: 28 Mar 2013 03:57 PM PDT I have read your post and I completely understand OPTIMIZE TABLE to perform in an environment where innodb_file_per_table is disabled, does not shrink the global ibdata1 tablespace. But what if I need to perform index maintenance on InnoDB tables with ANALYZE command, it will grow the single tablespace also? What other alternatives are there to increase performance or doing some maintenance in Innodb engine, when using a single tablespace and without grow out of control the single ibdata1. Regards. Matthew |
slow queries - set weight to token type in tsquery - postgresql Posted: 28 Mar 2013 07:57 PM PDT Postgresql version 9.2.3! I'm working on a database for mapping of chemical names. My main table contains aprox 91 million records and it's indexed by gin. I want to query it with multiple names (I'm trying now with 100 entries), which I first put in a query table, create a tsquery column of the names and index it with gist. Main table structure: I was trying different approaches, thus for testing gin index I created a clone: then: The query table is: Same as in the main table, I fill it in with COPY from via a temp table and then I add the tsquery column: The query is basically a join between both tables: lexemes is the gist indexed tsquery column on my query table, whereas tsv_syns is the gin indexed tsvector column in the main names table, the one with 91 million records. The query is intended to match names, exact matches if possible. It works very well for such a large table. Normal names, containing only characters, can be retreated even in microseconds. The problem is when the string names contains numbers. The operation tsvector and tsquery create one token for each number, and all together makes the query for this sort of entries rather slow, well, slower. Instead of a few milliseconds, they take aprox 1-2 seconds each. I would like to reduce this query time to a few milliseconds like the other entries, but I don't know how. I have tested it with and without ts_rank to find out that ranking only add half a second to the total query, if it even makes a difference. so that's not my problem Some samples queries are: query: result: (cid |name|synonym|tsv vector) query: result: query: result: I wonder what the best way to make this last queries faster would be. I have tried with a pre-processing script that removes all the numbers, it speeds up the search up to 3 seconds in total, but I miss the exact/closest match that I was looking for in some of the cases, so that's no use. Other approaches that came to mind where: I think this could be a potential good solution for me, but as far as I have seen cannot be done. Tsvectors/queries can be labelled, but not token types or IS THERE A WAY TO LABEL TOKENS DIFFERENTLY WITHIN THE SAME TSVECTOR? Same as the parser, it might lead me to wrong matches, although since it keeps the positional information it me perform good. I'm not sure how i should do this though. My postgres.conf parameters: I have tried lower amounts of shared_buffer and effective_cache_size (16GB and 32GB respectively), no difference in performance from the current one, so I'm planing to change it back to those limits I tried a gist index on querytree lexemes, didn't make much difference I'm a little bit lost and I would appreciate any ideas or possible solutions to speed up my queries. Thanks :) PD: Any recommendations for nonSQL DBs that could improve performance? |
how to import mysql system "mysql" database Posted: 28 Mar 2013 04:57 PM PDT This question might be already answered but it's almost impossible to google it. When I perform full backup of mysql server using then reinstall it from scratch I want to import FULL dump of all databases, including "mysql". I successfully done that by executing but now even if all user records are in I can't even change their password, I always get
Restarting mysqld is of no help answer: It was fixed by executing now all users work as before |
SUPER privilege not defined for master user in Amazon MySQL RDS Posted: 28 Mar 2013 12:57 PM PDT I have created one medium instance on amazon rds in asia pecific (singapore) region. i have created my master user with master password. and it is working/connecting fine with workbench installed on my local PC. When, I am going to create function on that instance, it show me following error
At my instance, my variable (log_bin_trust_function_creators) shows OFF. now when I go to change with variable using it gives me another error
I don't know how to solve this error. Can anybody help??? |
Posted: 28 Mar 2013 10:57 AM PDT I'm trying to optimize a MySQL Server to be able to serve as many connections as it can. The server is in AmazonAWS RDS and has currently the following resources:
I have run some stress test to check how many connections can serve but no matter what changes I make to the configuration, mysql can not serve more than 800. The rest of the processes are dropped. If someone can help I would be grateful. These are the variables in the configuration: |
How to import table's data in MySql from Sql Server? Posted: 28 Mar 2013 11:57 AM PDT I am trying to export table from SQL Server 2008 R2 TO MySql 5.5. For this I am using Here this error may be occurring because table in Sql Server has a column with data type Please provide your expert answers. If not possible through |
Is it possible to pipe the result of a mysqldump straight to rsync as the source argument? Posted: 28 Mar 2013 02:57 PM PDT Is it possible to pipe the result of a mysqldump straight to rsync as the source argument? Conceptually, I was thinking something like: I've seen people pipe the result to mysql for their one liner backup solution, but I was curious if it was possible with rsync. You know--- cause rsync is magic :) Thanks for your time! |
Need help with long running query Posted: 28 Mar 2013 01:57 PM PDT UPDATE: Adding a clustered index to each work table covering all fields reduced the query run times to su-bsecond. I consider this question closed. Thanks for taking the time to read this post - it's a bit late so hopefully this is probably borderline coherent if I'm lucky. SQL 2008 on windows 2008. We've got a 3rd party budgeting application that's part of our new ERP system. Users are running a forecasting process. From what I can tell, there are a set of work tables that are populated. Values from these tables are then inserted into a results table. The process has been getting slower and slower over the past few weeks. 2 hours has now become a 24 hour run that doesn't end. I've got sp_whoisactive (a augemented sp_who2 of sorts) running and I see CPU and Reads going through the roof. 10 Billion logical reads during one of today's runs - for one query. The entire DB is cached in memory with only a few physical reads. It's been running for 20 min now and is at 500 million reads. I dug into the INSERT / SELECT statement and started running subsections of it, removing joins and implementing the index recommendations from the showplan. This got everything humming up to a certain point in the process. The work tables were all heaps. Now it's stuck again on a similar SELECT / INSERT and I can't capture the parameters it's currently running with, since I have a trace running with Batch Completed only being captured - at least I don't know a way how to. Wait_Info from sp_whoisactive shows nothing. So tomorrow morning we are going to run it again and I'll capture those parameters. Hopefully that will shed some light. Below is my 'test harness' for the query. I grab a batch id from one of the work tables and then use it to build parameters for the query. The app servers are running JAVA using the Microsoft JDBC drivers, which wraps everything in sp prepares and execs, complicating things a bit. The application vendor has supplied us with a script to insert the same dummy batchID a few thousand times into these temp tables, generate stats and then set them to NORECOMPUTE. However, this wasn't helping and I don't really understand how it would. We're using the Hallengren maintenance scripts for index and stats maintenance. No other systems are having performance problems running on this server at this time. I ran a stock Index and Stats maintenance plan just to be sure I hadn't misconfigured the Hallengren scripts. I'm looking for some additional guidance on how to see what this query is actually working on while it is churning away. Edits: SHOWPLAN Text One other note, the query plan shows early termination due to plan timeout. |
MySQL Workbench sync keeps requesting the same changes Posted: 28 Mar 2013 05:57 PM PDT I am using MySQL Workbench, and when I try to "synchronize" it with my remote database, it keeps detecting some changes to make. Specifically, the most recurrent ones are:
I was compliant and executed all the queries given to me (and added the semi-colon that they forgot). MySQL didn't complain and executed them. However it didn't help, I can run it 20 times in a row, it will still ask the same useless changes. |
mysql performance / cache configuration enigma Posted: 28 Mar 2013 09:57 AM PDT I have two mysql 5.1 instances (say A, B) hosting the same database schema. If I run (with mysql workbench) the same query on both instances I don't understand why I get very different response times with subsequent requests. On instance A, first query execution takes 0.688s and second query execution takes 0.683s It looks like there's a cache configuration difference between the two instances but I can't find it. Comparing the Just to mention, instance A is our test environment and instance B is our production environment Edit : (recommended by @Rick James) The following variables are strictly identical on both environments The actual SELECT : The EXPLAIN SELECT (sam on both environments) : The CREATE TABLE STATEMENT (exact same on both except the constraint names) : and |
Copy Postgres databases with indexes between instances Posted: 28 Mar 2013 12:54 PM PDT How do you copy a single Postgres database between installations without using pg_dump and without regenerating indexes? We have an application we deploy which uses Postgres 8.4.7 database in Linux. We have a rather large static data set (4GB) which is is indexed. Using pg_dump we have to index the data once it is restored to the second Postgres instance. Indexing this data can take up to 80 minutes, so we would rather deploy the database with the index already generated. From postgres documentation it appears that databases are contained in sub-directories under postgresql/8.4/main/base based on their OID. My first attempt was to create an empty database in Postgres, shutdown the instance, then copy the data from the existing instance to the directory of the OID for the empty database. This failed as my indexes were not working. Preforming a vacuum gave me the following error: |
Getting max values from MySQL tables Posted: 28 Mar 2013 06:57 PM PDT I have three tables:
where: I need a query to select the latest |
Minimizing Indexed Reads with Complex Criteria Posted: 28 Mar 2013 09:59 AM PDT I'm optimizing a Firebird 2.5 database of work tickets. They're stored in a table declared as such: I generally want to find the first ticket that hasn't been processed and is in My processing loop would be:
Nothing too fancy. If I'm watching the database while this loop runs I see the number of indexed reads climbs for each iteration. The performance doesn't seem to degrade terribly that I can tell, but the machine I'm testing on is pretty quick. However, I've received reports of performance degradation over time from some of my users. I've got an index on -- Edits for comments -- In Firebird you limit row retrieval like: So when I say "first", I'm just asking it for a limited record set where |
Tools to migrate from SQLite to PostgreSQL Posted: 28 Mar 2013 04:16 PM PDT I need to continuously migrate from SQLite to PostgreSQL. By continuously, I mean that I will reimport the SQLite database into PostgreSQL every day. It would be nice if I could make changes to the tables in SQLite as I please without having to manually make any changes to the PostgreSQL database. I will run the migration from Python, but it could be any external tool, which can be controlled from command line. The tool needs to be available for Linux, and it would be nice if it also ran on Windows. |
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 |